You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Martin Lichtin <li...@yahoo.com.INVALID> on 2018/05/05 21:16:23 UTC
Re: Re: DirectConsumerNotAvailableException: No consumers available
on endpoint
Thanks, the block option for the direct: component helped.
However, in general, there's a more apparent timing issue after the version upgrade.
If the CamelContext is not ready, then one cannot start routes.
I had to resort to registering a "StartupListener" to be notified, before trying to start routes.
On 26.04.2018 19:20, Alex Dettinger wrote:
> You may be interested in routes startupOrder
> <https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderWithDefaultTest.java>
> or the block option
> <https://github.com/apache/camel/blob/camel-2.19.x/camel-core/src/main/docs/direct-component.adoc>
> which you may need to set to true on your own in 2.19.5.
>
> On Thu, Apr 26, 2018 at 6:24 PM, Martin Lichtin <li...@yahoo.com.invalid>
> wrote:
>> After upgrading from 2.18 to 2.19.5, I'm often seeing this exception at
>> startup.
>> It looks like the auto-started route is not immediately ready?
>>
>> Using a producer template, it can happen that
>> "DirectConsumerNotAvailableException" is thrown.
>> At next try (e.g. a second later) it works.
>> How can this be avoided?
>>
>> org.apache.camel.component.direct.DirectConsumerNotAvailableException: No
>> consumers available on endpoint: direct://myRoute.
>> Exchange[ID-mypc-27743-1524756340687-3-2]
>> at org.apache.camel.component.direct.DirectProducer.process(Dir
>> ectProducer.java:55)
>> at org.apache.camel.processor.CamelInternalProcessor.process(Ca
>> melInternalProcessor.java:198)
>> at org.apache.camel.processor.DelegateAsyncProcessor.process(De
>> legateAsyncProcessor.java:97)
>> at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerC
>> ache.java:529)
>> at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerC
>> ache.java:497)
>> at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCac
>> he.java:365)
>> at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCac
>> he.java:497)
>> at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:225)
>> at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultPr
>> oducerTemplate.java:144)
>> at org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHea
>> ders(DefaultProducerTemplate.java:257)
>>
>>
>> Thanks
>>
>> - Martin
>>
>>