Hi

Yeah in Camel 2.1 you now have full control of these situations where
you can dictate the order
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html

And all the routes are pre started, before at the end the consumers is
started and thus these situations is much less likely to occur in 2.1
out of the box.

In 1.6.x I am afraid you can try changing the order in which the
routes are listed in your RouteBuilder as it can help Camel to start
them in the order you want, albeit the order is not controlled as with
2.1.

And if you use timers or the likes then set an initial delay so they
wont fire immediately.




On Thu, Dec 10, 2009 at 6:57 PM, erh <[email protected]> wrote:
>
> I'm having trouble with what seems to be a race condition during Camel
> startup, which is causing "No getConsumers() available on Producer" errors
> to happen:
>
> [2009-12-10
> 05:05:03,026][WARN][DefaultMessageListenerContainer-1][component.direct.DirectProducer(DirectProducer)-process(44)]:
> No getConsumers()
>  available on Producer[direct:coreServerDispatch] for Exchange[Message:
> com.tuc.batchbase.message.datamess...@e29d53]
>
> The consumer that tries to send things to this endpoint is added a few
> milliseconds earlier, but the consumer for "direct:coreServerDispatch" isn't
> added until *after* this error (TuLifecycleStrategy is a subclass of
> DelegateLifecycleStrategy that just logs any calls to onServiceAdd()):
>
> [2009-12-10
> 05:05:03,048][WARN][main][batchbase.camel.TuLifecycleStrategy(TuLifecycleStrategy)-onServiceAdd(36)]:
> Adding service: Consumer on Endpoint[direct:coreServerDispatch]
>
> I've seen other messages about this in the archives that mention things like
> turning off JMX
> (http://old.nabble.com/Aggregator-Problems-ts20085385.html#a20085385).  I
> haven't tried that yet, but I'm wondering why it would make a difference.
> It looks like the issue is that the consumers get started before all the
> routes are setup.  Wouldn't that still happen even with JMX off?
>
> I'm using Camel 1.6.2 (release).
>
> Also, it seems there a similar issue with a timer route, where the timer
> fires before the processor is ready; the error message in that case is "
> java.lang.IllegalStateException: No producer, this processor has not been
> started! while processing exchange: Exchange[Message: null]"
>
> eric
> --
> View this message in context: 
> http://old.nabble.com/Getting-%22No-getConsumers%28%29-available-on-Producer%22-on-startup-tp26731788p26731788.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to