You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hossein <ma...@csc.com> on 2010/10/20 22:19:05 UTC

JMS filtering based on selector

Hello,

Using camel 2.2, I'm attempting to select only certain messages from queue
using the following:

from("activemq:queue:somequeue?selector=clientid='someid'").to(someOtherQueue)
where 
clientid was set using: exchange.getOut().setHeader("clientid", "someid")

Is above correct? For some reason, I don't get the filtered message and the
result is camel return ALL messages of the initial queue?

Thanks.
---
Hossein Amerkashi

-- 
View this message in context: http://camel.465427.n5.nabble.com/JMS-filtering-based-on-selector-tp3229317p3229317.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: JMS filtering based on selector

Posted by Claus Ibsen <cl...@gmail.com>.
Check the unit tests of camel-jms to see some samples.

On Thu, Oct 21, 2010 at 7:22 AM, Norman <no...@apache.org> wrote:
>  Hi there,
>
> you need to pass the "=" as "%3D" as stated in the component docs.
>
>
> See:
> http://camel.apache.org/jms.html
>
> So it would be:
>
> from("activemq:queue:somequeue?selector=clientid %3D
> 'someid'").to(someOtherQueue)
>
>
> Bye,
> Norman
>
> Am 20.10.2010 22:19, schrieb Hossein:
>>
>> Hello,
>>
>> Using camel 2.2, I'm attempting to select only certain messages from queue
>> using the following:
>>
>>
>> from("activemq:queue:somequeue?selector=clientid='someid'").to(someOtherQueue)
>> where
>> clientid was set using: exchange.getOut().setHeader("clientid", "someid")
>>
>> Is above correct? For some reason, I don't get the filtered message and
>> the
>> result is camel return ALL messages of the initial queue?
>>
>> Thanks.
>> ---
>> Hossein Amerkashi
>>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: JMS filtering based on selector

Posted by Norman <no...@apache.org>.
  Hi there,

you need to pass the "=" as "%3D" as stated in the component docs.


See:
http://camel.apache.org/jms.html

So it would be:

from("activemq:queue:somequeue?selector=clientid %3D 'someid'").to(someOtherQueue)


Bye,
Norman

Am 20.10.2010 22:19, schrieb Hossein:
> Hello,
>
> Using camel 2.2, I'm attempting to select only certain messages from queue
> using the following:
>
> from("activemq:queue:somequeue?selector=clientid='someid'").to(someOtherQueue)
> where
> clientid was set using: exchange.getOut().setHeader("clientid", "someid")
>
> Is above correct? For some reason, I don't get the filtered message and the
> result is camel return ALL messages of the initial queue?
>
> Thanks.
> ---
> Hossein Amerkashi
>


Re: JMS filtering based on selector

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Hossein,

Before Camel 2.3.0, we don't support the selector in CamelConsumerTemplate.

Anyway the selector option is an SQL92 predicate. Some character such as 
= should be encoded as %30 to be interpreted by Camel.

Regards
JB

On 10/20/2010 10:19 PM, Hossein wrote:
>
> Hello,
>
> Using camel 2.2, I'm attempting to select only certain messages from queue
> using the following:
>
> from("activemq:queue:somequeue?selector=clientid='someid'").to(someOtherQueue)
> where
> clientid was set using: exchange.getOut().setHeader("clientid", "someid")
>
> Is above correct? For some reason, I don't get the filtered message and the
> result is camel return ALL messages of the initial queue?
>
> Thanks.
> ---
> Hossein Amerkashi
>