You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jgunz <sl...@twcny.rr.com> on 2007/09/26 18:20:18 UTC
JMS Selectors in Camel
On to the next problem! I'm having trouble adding a selector to my JMS
consumer when using Camel. I want to selectively consume messages based on a
header field but the selection HAS to be done within the broker so that I
can limit the bandwidth required for consumers. I can't figure out how to do
this though.
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
context.addComponent("test-jms",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
--
View this message in context: http://www.nabble.com/JMS-Selectors-in-Camel-tf4523347s22882.html#a12904323
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JMS Selectors in Camel
Posted by James Strachan <ja...@gmail.com>.
On 26/09/2007, jgunz <sl...@twcny.rr.com> wrote:
>
> On to the next problem! I'm having trouble adding a selector to my JMS
> consumer when using Camel. I want to selectively consume messages based on a
> header field but the selection HAS to be done within the broker so that I
> can limit the bandwidth required for consumers. I can't figure out how to do
> this though.
>
>
> ConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
> context.addComponent("test-jms",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
You specify consumption options such as selector on the endpoint. This
was missed off the documentation page; I've just updated...
http://cwiki.apache.org/CAMEL/jms.html
You can specify the selector query argument on the URI to specify the
selector; though you might have to escape the = sign etc.
from("activemq:My.Queue?selector=foo%3D'bar'").to("log:foo")
Another option is to configure the endpoint directly...
JmsEndpoint endpoint = camelContext.getEndpoint("activemq:My.Queue",
JmsEndpoint.class);
endpoint.setSelector("foo='bar'");
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com