You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by zuff <bh...@live.com> on 2012/10/12 11:00:34 UTC
Camel Confusion
Dear All,
I'm suddenly feel a bit loss on the usage and behaviour of camel and
will like to seek clarification.
<camel:camelContext>
<route id="processRequest">
<from uri="activemq:topic:request"/>
<bean ref="eventProcessor" method="processEvent"/>
</route>
<route id="sendResponse">
<from uri="direct:myProxy"/>
<setProperty propertyName="result">
<method ref="convertor"/>
</setProperty>
<bean ref="strategyManager"
method="isStrategyCompleted(${property.result})"/>
<choice>
<when>
<simple>${body}</simple>
<bean ref="camelJMS"
method="sendComplete(${property.result})"/>
</when>
</choice>
</route>
</camel:camelContext>
Given the scenario:
T=0; Request 1 published to activemq:topic:request
T=1; Request 2 published to activemq:topic:request
T=3; Request 3 published to activemq:topic:request
T=60; (External system place the result file for Request 2 into a folder),
picked up by
<from uri="direct:myProxy"/> in route sendResponse
My question.
1. Does camel start a new instance for all new message at
activemq:topic:request
2. If it does, will all 3 instances perform route sendResponse, even though
its not for them?
3. Camel is single instance, but will help to keep track of the exchanges
for you? (Very vague, and I not sure whether I imagining the correct
scenario.
4. Any other behaviour? I doubt it will hang at route 2, while waiting for
it to be trigger even if there are news messages on the
activemq:topic:request
Thanks and Best Regards,
Zuff
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Confusion-tp5720952.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Confusion
Posted by zuff <bh...@live.com>.
Hi Willem ,
You bring out an very important point, I have no linkage between the two
routes. that is the part of the main reason for my confusion. Being new to
Camel, I'm still not sure how does
a. System A receive requests through JMS
b. sent request to an external system
c. Receive the response (which can be time consuming and not gurantee to
return in the order, that request is received)
d. Response back the result.
Will a pollEnricher work in this case? if yes, how do i get the
aggreatorStrategy to make sure this is the result for this request?
Appreicated any guidance.
Zuff
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Confusion-tp5720952p5721019.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Confusion
Posted by zuff <bh...@live.com>.
I have a feeling that my route is wrongly designed, although it appear to
work in a single client environment
But I believe problem will arise once they are.multiple client
As there aren't any correlation between the processRequest and sendRespond.
Are there any EIP that can help to resolve?
Thanks
Zuff
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Confusion-tp5720952p5720974.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Confusion
Posted by zuff <bh...@live.com>.
Hi Williem ,
Thanks for your prompt reply.
Route "processRequest" will consume from activemq:topic:request
And generate ticket.xml and place into various folders that will be picked
up
By a third party software.
The third party software will generate various xml files amid placed into
different folders,
direct:myProxy is actually a bean that polls thsee folders.
However as the third party software also perform priorirization ,
The order that the result are completed are not guaranteed to be the same
order of what is sent.
As the processing to generate the result we need take 10 seconds to more
than 7 hours.
Meaning :
T=1 low priority job A sent
T=2 low priority job B sent& processing started for job A
T=3 HIGH priority Job c sent
T=5 Job A completed, job C started
T=6 job C completed, job B started
T=1000 job B completed
Thanks and Best Regards
Zuff
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Confusion-tp5720952p5720957.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Confusion
Posted by Willem jiang <wi...@gmail.com>.
Hi
I don't get what the instance that you mention in your questions.
Camel will create a new Message when it get the mms from the topic queue.
I don't know how you link the "processRequest" route to "sendPesponse" route.
It is important for us to answer the question of 4.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Friday, October 12, 2012 at 5:00 PM, zuff wrote:
> Dear All,
>
> I'm suddenly feel a bit loss on the usage and behaviour of camel and
> will like to seek clarification.
>
> <camel:camelContext>
>
> <route id="processRequest">
> <from uri="activemq:topic:request"/>
> <bean ref="eventProcessor" method="processEvent"/>
> </route>
>
> <route id="sendResponse">
> <from uri="direct:myProxy"/>
> <setProperty propertyName="result">
> <method ref="convertor"/>
> </setProperty>
> <bean ref="strategyManager"
> method="isStrategyCompleted(${property.result})"/>
> <choice>
> <when>
> <simple>${body}</simple>
> <bean ref="camelJMS"
> method="sendComplete(${property.result})"/>
> </when>
> </choice>
> </route>
> </camel:camelContext>
>
>
> Given the scenario:
>
>
> T=0; Request 1 published to activemq:topic:request
> T=1; Request 2 published to activemq:topic:request
> T=3; Request 3 published to activemq:topic:request
> T=60; (External system place the result file for Request 2 into a folder),
> picked up by
> <from uri="direct:myProxy"/> in route sendResponse
>
> My question.
> 1. Does camel start a new instance for all new message at
> activemq:topic:request
> 2. If it does, will all 3 instances perform route sendResponse, even though
> its not for them?
>
> 3. Camel is single instance, but will help to keep track of the exchanges
> for you? (Very vague, and I not sure whether I imagining the correct
> scenario.
>
> 4. Any other behaviour? I doubt it will hang at route 2, while waiting for
> it to be trigger even if there are news messages on the
> activemq:topic:request
>
> Thanks and Best Regards,
> Zuff
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Confusion-tp5720952.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).