> For example, I have a queue named testqueue1 on server1.
> I have messages msg1,msg2,msg3,msg4,msg5 on testqueue1.
>
> I have multiple camel instances running on different servers, say server2,
> server3,server4 which will be listening to testqueue1.
> I want server2 instance to pick only msg1 and msg2, server3 instance to pick
> only msg3 , server4 instance should pick msg4 and msg5.
> How can I achieve this?

Another option is to consider reading from the queue using Camel and
sending messages to destinations using the Content Based Router [1].

server1:
from("jms:queue").choice().
  when().header("MSG1").isNotNull().
    to("jms:server2queue").
  when().header("MSG2").isNotNull().
    to("jms:server3queue").
  otherwise().
    to("jms:server4queue").
endChoice();

server2:
from("jms:server2queue").to("direct:processing")

...and so forth.

[1] http://camel.apache.org/content-based-router.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Reply via email to