You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by deepak_a <an...@gmail.com> on 2013/07/18 18:35:13 UTC

Round Robin in Camel Routes

Hi,

In my architecture I am using Jboss+ActiveMQ (integrated) and activeMQ.
is it possible to have a camel route that does round-robin from one or more
ActiveMQ queues?

The round-robin I am trying to get is at the consumer end. 
This way my route can pull/consume messages at an even/constant rate.

 


regards
D



--
View this message in context: http://camel.465427.n5.nabble.com/Round-Robin-in-Camel-Routes-tp5735857.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Round Robin in Camel Routes

Posted by deepak_a <an...@gmail.com>.
Yes,

****** expecting your consumers 
to actively fetch messages. *********

-> That's where I was trying to get to!

Thanks for the explanation - its much clear now. 



--
View this message in context: http://camel.465427.n5.nabble.com/Round-Robin-in-Camel-Routes-tp5735857p5736014.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Round Robin in Camel Routes

Posted by Andreas Gies <an...@wayofquality.de>.
Still kind of confused ;)

If I understand correctly you have 3 inbound routes from different
locations all of which point to a Active MQ Queue.

If you have only one consumer the messages will be processed in the order
they arrive in the queue (wellŠin the simplest case)
regardless where they came from.

If you have more than one consumer on the queue, that changes. The
messages will be processed in a round robin fashion
across your consumers. If you want to have a dedicated set of consumers
for each inbound endpoint, I would suggest different queues.
If you can't do that you can use message selectors or filters in camel.

If you need to route groups of messages to the same consumer, you should
have a look at ActiveMQ's message group feature
(http://activemq.apache.org/message-groups.html).


I *think* that reading between the lines you are expecting your consumers
to actively fetch messages. IMHO an ESB architecture
is primarily event driven, so that the inbound side pushes messages and
the consumer side is notified when those messages arrive.
The underlying JMS Broker (in this case ActiveMQ) allows all kind of
dispatching strategies.


Hope that helps
Andreas







Am 7/18/13(29) 7:02 PM schrieb "deepak_a" unter <an...@gmail.com>:

>Hi,
>
>I was not clear in my earlier query.
>let me clarify.
>
>In my current architecture I have multiple routes set up.
>Each route has has a unique 'from' point and a 'to' end point (that is
>common for all routes)
>
>e.g.
>
>Route 1: From: MQ-Queue;    To: inbound.Queue (in activeMQ)
>Route 2: From: FTP;             To: inbound.Queue (in activeMQ)
>Route 3: From: Webservice;   To: inbound.Queue (in activeMQ)
>
>The issue I am facing is - since my destination (To end point) is Queue
>that
>is common for all routes, I am not able to evenly process the messages
>from
>each endpoint.
>
>My query is is it possible to set up one route like this
>
>Route 1:
>From: MQ-Queue;
>From: FTP;
>From: Webservice; 
>To: inbound.Queue (in activeMQ)
>
>The same route consumes messages from each from point in a round-robin
>manner and push message to the destination?
>
>
>regards
>D
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Round-Robin-in-Camel-Routes-tp5735857p57
>35860.html
>Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Round Robin in Camel Routes

Posted by deepak_a <an...@gmail.com>.
Hi,

I was not clear in my earlier query.
let me clarify.

In my current architecture I have multiple routes set up.
Each route has has a unique 'from' point and a 'to' end point (that is
common for all routes)

e.g.

Route 1: From: MQ-Queue;    To: inbound.Queue (in activeMQ)
Route 2: From: FTP;             To: inbound.Queue (in activeMQ)
Route 3: From: Webservice;   To: inbound.Queue (in activeMQ)

The issue I am facing is - since my destination (To end point) is Queue that
is common for all routes, I am not able to evenly process the messages from
each endpoint.

My query is is it possible to set up one route like this

Route 1:
From: MQ-Queue;
From: FTP;
From: Webservice; 
To: inbound.Queue (in activeMQ)

The same route consumes messages from each from point in a round-robin
manner and push message to the destination?


regards
D



--
View this message in context: http://camel.465427.n5.nabble.com/Round-Robin-in-Camel-Routes-tp5735857p5735860.html
Sent from the Camel - Users mailing list archive at Nabble.com.