On Tue, Jul 26, 2011 at 5:22 PM, ghepardo <e.gherard...@hotmail.com> wrote: > Hi, > thanks for answering. > > My main concern is this: > in coherence, to listen for a message, I have a blocking call > (subscription.getMessage()). > > I cannot invoke this call inside the overridden doStart() or start() > methods, because, to my knowledge, these would block camel. > > The only way I found is to start a new thread and let it perform this > blocking call. > > > Is this the correct way to deal with blocking calls inside a Consumer ? >
Yeah that is correct. Mind that if you use a blocking call to coherence, then you may block for a long time. And when you shutdown your application, that blocking call has to be interrupted. So you may have to handle this in a gentle way when shutting down / stopping. In the Camel seda consumer we use a timeout, to have a more gentle way of knowing if we are stopping. And mind that in the runnable, if you exit the runnable (such as a throwable exception was thrown etc.) then the thread terminates. And the consumer will not pickup new messages. So you have to deal with that as well. > Thanks. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Developing-Oracle-Coherence-3-7-Camel-Component-tp4618649p4635220.html > Sent from the Camel Development mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/