camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Developing Oracle Coherence 3.7 Camel Component
Date Tue, 26 Jul 2011 16:04:08 GMT
On Tue, Jul 26, 2011 at 5:22 PM, ghepardo <e.gherardini@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: 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/

Mime
View raw message