Hi Gert,

    Thanks for replying.
     I tried your solution for iterating the set and and creating a
comma-separated string.

    Application Flow:

    Bean-SU --> Camel-SU ---> JMSProvider-SU(Topic) ---> JMSConsumer-SU


    In above flow, Bean-SU creating the comma-separated string and sets this
as a property for the message. Camel-Su forwards the message to JMSProvider
(Topic).

    Messages in the topic do not contain any properties (observed using
JCONSOLE).

    So my JMSConsumer is not able to consume any message, since
messageSelector criteria never matches.

    Camel SU:
    <route>
      <from
uri="jbi:service:http://servicemix.in2m.com/operations/updateprofile/routingService"/>
      <to
uri="jbi:service:http://servicemix.in2m.com/operations/updateprofile/JMSProviderService?mep=in-only"/>
    </route>

    JMSConsumerSU:

          <jms:consumer service="hello:JMSConsumerService"
                  endpoint="DirectorConsumer"
                    targetService="hello:DirectorService"
                  pubSubDomain="true"
                  destinationName="updateUserProfileTopic"
                  connectionFactory="#connectionFactory"
                  messageSelector="userPrincipals LIKE '%smx1%'" />
   
   
   plz help me?

Sandeep


Gert Vanthienen wrote:
> 
> 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
>>
>>
>>   
> 
> 
> 
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
> 

-- 
View this message in context: 
http://www.nabble.com/help-with-JMSConsumer-message-selector--tp18033749p18084149.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to