You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sanjai <sa...@sanjai.org> on 2011/09/30 16:47:17 UTC

How to consume from multiple JMS queues?

Hello all,

I need a route to consume from multiple JMS (not activemq) queues.  It seems
that the JMS Component does not have a direct way to do this.  To add to the
complexity, the queues that the route reads from can change during runtime. 
Can someone guide me how this can be done within Camel?

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857383.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume from multiple JMS queues?

Posted by Christian Schneider <ch...@die-schneider.net>.
You could use one queue and jms selectors. See: 
http://camel.465427.n5.nabble.com/JMS-filtering-based-on-selector-td3229317.html

Christian


Am 30.09.2011 18:45, schrieb sanjai:
> Each queue contains data for a separate customer.   Customers can pull data
> from their queue indirectly via a web service call they make to us which
> pulls from the company queues and return the resulting messages.  However,
> there are some customers who want us to "push" data to them by calling their
> web service.
>
> It is this second scenario I need to implement.  Since all this data is
> handled the same way, I just wanted one route which reads from these queues,
> processes the data, and sends the data to the customer by calling their web
> service endpoint.  I can try Claus's suggestion.  Another option is to
> change the process that writes to the queues to only write to one common
> queue, but I was hoping to avoid that.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857780.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: How to consume from multiple JMS queues?

Posted by sanjai <sa...@sanjai.org>.
Each queue contains data for a separate customer.   Customers can pull data
from their queue indirectly via a web service call they make to us which
pulls from the company queues and return the resulting messages.  However,
there are some customers who want us to "push" data to them by calling their
web service.  

It is this second scenario I need to implement.  Since all this data is
handled the same way, I just wanted one route which reads from these queues,
processes the data, and sends the data to the customer by calling their web
service endpoint.  I can try Claus's suggestion.  Another option is to
change the process that writes to the queues to only write to one common
queue, but I was hoping to avoid that.

--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857780.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume from multiple JMS queues?

Posted by Christian Schneider <ch...@die-schneider.net>.
For queues this does not work but you could try topics with wildcards. I 
think that should work with pure JMS.

Can you tell us a bit more about the use case? Perhaps this can also be 
solved differently.

Christian


Am 30.09.2011 16:47, schrieb sanjai:
> Hello all,
>
> I need a route to consume from multiple JMS (not activemq) queues.  It seems
> that the JMS Component does not have a direct way to do this.  To add to the
> complexity, the queues that the route reads from can change during runtime.
> Can someone guide me how this can be done within Camel?
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857383.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: How to consume from multiple JMS queues?

Posted by sanjai <sa...@sanjai.org>.
Thanks Claus.  I'll try that.

--
View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to consume from multiple JMS queues?

Posted by Claus Ibsen <cl...@gmail.com>.
AMQ supports wildcard in destinations so a consumer can consume from
multiple queues.
But that is an AMQ specific feature.

You can add multiple from to a route.

You can add new routes at runtime, so the new routes consume from the
new queues.
Likewise you can stop/remove routes as well.



On Fri, Sep 30, 2011 at 4:47 PM, sanjai <sa...@sanjai.org> wrote:
> Hello all,
>
> I need a route to consume from multiple JMS (not activemq) queues.  It seems
> that the JMS Component does not have a direct way to do this.  To add to the
> complexity, the queues that the route reads from can change during runtime.
> Can someone guide me how this can be done within Camel?
>
> Thanks
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-consume-from-multiple-JMS-queues-tp4857383p4857383.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/