What is your problem, your route seems at first glance okay.
You are right to use the Content Based Router to route depending on the message.
http://camel.apache.org/content-based-router.html
On Mon, Apr 16, 2012 at 9:24 AM, Nafees wrote:
Hi ,
I am new to Apache Camel. I am facing this problem..
Depending on message coming from activemq , i have to select the
appropriate route ..
// a bean which is sending message to activemq using jms
from("bean:idProducer?method=sendMessage").to("jms:queue:myqueue1");
Mind that when doing this, Camel will keep calling the beanHi ,
I am new to Apache Camel. I am facing this problem..
Depending on message coming from activemq , i have to select the
appropriate route ..
// a bean which is sending message to activemq using jms
from("bean:idProducer?method=sendMessage").to("jms:queue:myqueue1");
continuously which mean a lot of messages is sent to the queue.
You may want to look at using a timer to trigger messages to be routed
at a slower pace
http://camel.apache.org/timer
// from message coming from activemq.. if user send ftp as message i need to
incoke route1 or route 2
from("jms:queue:myqueue1")
.choice()
.when(body().contains("ftp")).to("bean:mediationSource?method=ftpServer")
This predicate will just check that the message body contains theincoke route1 or route 2
from("jms:queue:myqueue1")
.choice()
.when(body().contains("ftp")).to("bean:mediationSource?method=ftpServer")
string "ftp". Is this what you want to do?
.to("bean:mediationSource?method=localLocation")
.to("bean:mediationSource?method=pickFile")
.beanRef("ggsnToBdrProcessor")
.when(body().contains("local")).to("bean:mediationSource?method=localDataLocation")
.to("bean:mediationSource?method=pickFile")
.beanRef("ggsnToBdrProcessor");
what could i do in this regard and i want to consume the jms message only
once and run the routes.
Thanks in advance
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-invoke-a-route-based-on-incoming-ftp-message-tp5643121p5643121.html
Sent from the Camel - Users mailing list archive at Nabble.com.
.to("bean:mediationSource?method=pickFile")
.beanRef("ggsnToBdrProcessor")
.when(body().contains("local")).to("bean:mediationSource?method=localDataLocation")
.to("bean:mediationSource?method=pickFile")
.beanRef("ggsnToBdrProcessor");
what could i do in this regard and i want to consume the jms message only
once and run the routes.
Thanks in advance
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-invoke-a-route-based-on-incoming-ftp-message-tp5643121p5643121.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
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/