Sandeep Reddy,

I don't think that is possible with JMS Message selector syntax. It does have an IN keyword like SQL, but that one only takes a collection of String literals. There as some examples of what you can do in http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/selector/SelectorTest.java?revision=408638.

For your use case, you could expand the list of userPrincipals in a comma-separated syntax and use the LIKE expression syntax go check it.

Regards,

Gert

sandeep reddy wrote:
I have servicemix-camel 3.2.2 snapshot in my ServiceMix 3.2.1 instance.

I need to implement JMS Consumer which subscribe to a topic but only accept
a message based on selection criteria specified in messageSelector. My
message contains a property which is a List object containing String
elements. My JMS consumer need to accept a message based on the contents in
the List. I am not able to figure out how to write a message selection
criteria for it in a single string. I have implemented similar logic in
Camel in Java using header("userPrincipals").contains("portal") but not sure
on how to what to set in message selector.

Please advice.

Thanks in advance,
Sandeep Reddy



Reply via email to