Hi,

I have loose a couple of hours on this issue, so maybe this can save yours.

Context :
a route builder in blueprint container with :
* 1 route (A) like : from(consumer)...to("direct:...")
* 1 route (B) like : from("direct:...")...
* a call of an API on CamelContext in configure() or during route
initialization 

=> route A can start before route B, with the WARN message "No consumers
available on endpoint..." 

So we use startupOrder for manually reorder route startup, but it don't
work.

In fact, in the log, we can see something like this :
/INFO  | BlueprintCamelContext  |camel-core - 2.8.5 | *Total 0 routes, of
which 0 is started.*
INFO  | BlueprintCamelContext  |camel-core - 2.8.5 | *Apache Camel 2.8.5
(CamelContext: 201-camel-39) started in 2.304 seconds*
INFO  | BlueprintCamelContext  |camel-core - 2.8.5 | Route: AMQ started and
consuming from: Endpoint[amq://input]
INFO  | BlueprintCamelContext  |camel-core - 2.8.5 | Route: DIRECT started
and consuming from: Endpoint[direct://next]/

The routes have been started AFTER CamelContext starts..., in fact, it's
CamelContext who had start before full initialization of Blueprint
container... because of the call of a CamelContext API.

This happen in this cases for me :
* Call to CamelContext.getEndpoint(...)
* Call to CamelContext.getComponent(...) (called by getEndpoint() in fact)
* Use of @Produce annotation in a bean loaded by the route

The issue was fixed by https://issues.apache.org/jira/browse/CAMEL-5712 in
2.10.3
but there is a dead lock fixed by
https://issues.apache.org/jira/browse/CAMEL-6068 in 2.10.4

So you have to upgrade to 2.10.4... or avoid calls to CamelContext API in
configure() method.

Potential related posts :
http://camel.465427.n5.nabble.com/bug-in-startup-order-td5721055.html
http://camel.465427.n5.nabble.com/direct-vm-in-OSGI-td5728389.html
http://camel.465427.n5.nabble.com/Multi-CamelContext-getComponent-called-in-configure-break-some-initialization-td5729235.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-8-5-No-consumers-available-on-endpoint-startupOrder-don-t-work-Upgrade-to-Camel-2-10-4-tp5731982.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to