camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: Start order
Date Thu, 31 Jul 2008 04:55:00 GMT
Hi Vadim

Yes you are correct. It is more likely to be a problem for scheduled consumer, configured
to fire immediately.

So if you have a consumer then you should call super.doStart() at the end. 
Otherwise its executor (ScheduledExecutorService) could be triggered before you are complete
with your start and run the poll() method. And in you case the chat isn't initialized and
joined the room.

Maybe we should rework the internals of Camel so it will delegate its creation of the ScheduledExecutorService
to happen after the doStart() operation completes in a special callback method. Then component
writers don't have to worry so much if super should be in top/bottom?

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
-----Original Message-----
From: Vadim Chekan [] 
Sent: 30. juli 2008 08:30
Subject: Start order

In Producer or Consumer in start/stop mode, what should be the "super" 
call order?

     protected void doStart() {
         if (chat == null) {
             chat = new MultiUserChat(endpoint.getConnection(), room);

Wouldn't the endpoint signaling that it is ready when in fact it is not 
(joining chat may take some seconds)?


View raw message