No idea but asynchronous will free up the thread to do other tasks and not 
cause the error that there are in flight messages.

Here is the camel guide :

"Notice: As Camel always returns a Future handle for Async messaging to the 
client. The client can use this handler to get hold of the status of the 
processing whether the task is complete or an Exception occured during 
processing. Note that the client is not required to do so, its perfect valid to 
just ignore the Future handle.
        In case you want to know whether the Async Request Only failed, then 
you can use the Future handle and invoke get() and if it throws a 
ExecutionException then the processing failed. The caused exception is wrapped. 
You can invoke isDone() first to test whether the task is done or still in 
progress. Otherwise invoking get() will wait until the task is done."

So basically, if you estimate your EJB to take one hour to complete, then 
invoke isDone() and check the status code whether you want to proceed further 
with the route.



-----Original Message-----
From: vishal1981 [mailto:vishal.changr...@ericsson.com]
Sent: Monday, November 12, 2012 8:57 AM
To: users@camel.apache.org
Subject: RE: Forcefully shutting down routes...

Thanks for the reply.
Is there a reason why one should not block on an EJB for that long? Idea for
the async processing is great but then again I will have to introduce some
kind of mechanism to wait till the processor is done to invoke the next
processor in the route. There are processors which are before the EJB (such
as XML validation etc) and processors which are after the EJB processors
(e.g. other EJBs, FTP producer etc.) Synchronous (single threaded model)
really suits my application.

I am contemplating the following,
1. Subclassing the DefaultShutdownStrategy and just before calling
super.doShutdown() remove all exchanges belonging to this route from the
repository.
2. The defaultShutdownstrategy would then stop my ejb consumer. (What
happens to the Timer thread which is running that consumer is yet to be
determined; I am hoping the thread is unaffected).

-v-



--
View this message in context: 
http://camel.465427.n5.nabble.com/Forcefully-shutting-down-routes-tp5722447p5722560.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.

Reply via email to