You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Fladnag <fl...@zerezo.com> on 2013/05/03 16:26:53 UTC

[Camel 2.8.5] No consumers available on endpoint / startupOrder don't work : Upgrade to Camel 2.10.4

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.

Re: [Camel 2.8.5] No consumers available on endpoint / startupOrder don't work : Upgrade to Camel 2.10.4

Posted by Fladnag <fl...@zerezo.com>.
In fact, the issue is still here in SMX 4.5.2 with Camel 2.10.6

Any call to getCamelContext() during initialization start the
BlueprintCamelContext.

An example of the issue :

* Create a route with an endpoint injection :




=> The context is created and started when the producer is resolved :

Daemon Thread [Blueprint Extender: 3] (Suspended (entry into method start in
DefaultCamelContext))	
	owns: Object  (id=17032)	
	owns: AtomicBoolean  (id=17033)	
	owns: AtomicBoolean  (id=17034)	
	*BlueprintCamelContext(DefaultCamelContext).start() line: 1427	*
	BlueprintCamelContext.start() line: 162	
	BlueprintCamelContext.maybeStart() line: 174	
	BlueprintCamelContext.serviceChanged(ServiceEvent) line: 132	
	EventDispatcher.invokeServiceListenerCallback(Bundle, EventListener,
Filter, Object, EventObject, Dictionary) line: 871	
	EventDispatcher.fireEventImmediately(EventDispatcher, int, Object[],
EventObject, Dictionary) line: 733	
	EventDispatcher.fireServiceEvent(ServiceEvent, Dictionary, Framework) line:
662	
	Felix.fireServiceEvent(ServiceEvent, Dictionary) line: 3890	
	Felix.access$000(Felix, ServiceEvent, Dictionary) line: 79	
	Felix$2.serviceChanged(ServiceEvent, Dictionary) line: 728	
	ServiceRegistry.registerService(Bundle, String[], Object, Dictionary) line:
107	
	Felix.registerService(BundleImpl, String[], Object, Dictionary) line: 2979	
	BundleContextImpl.registerService(String[], Object, Dictionary) line: 313	
	BundleContextImpl.registerService(String, Object, Dictionary) line: 287	
	BlueprintCamelContext.init() line: 91	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	ReflectionUtils.invoke(AccessControlContext, Method, Object, Object...)
line: 225	
	BeanRecipe.invoke(Method, Object, Object...) line: 838	
	BeanRecipe.runBeanProcInit(Method, Object) line: 638	
	BeanRecipe.internalCreate() line: 726	
	BeanRecipe(AbstractRecipe).create() line: 64	
	BlueprintRepository.createInstances(Collection<String>) line: 219	
	BlueprintRepository.createInstance(String) line: 198	
	BlueprintRepository.create(String) line: 137	
	BlueprintContainerImpl.getComponentInstance(String) line: 709	
	*CamelNamespaceHandler$CamelInjector.getCamelContext() line: 642	

CamelNamespaceHandler$CamelInjector(CamelPostProcessorHelper).getEndpointInjection(String,
String, String, boolean) line: 135	

CamelNamespaceHandler$CamelInjector(CamelPostProcessorHelper).createInjectionProducerTemplate(String,
String, String) line: 177	

CamelNamespaceHandler$CamelInjector(CamelPostProcessorHelper).getInjectionValue(Class<?>,
String, String, String, Object, String) line: 144	
	CamelNamespaceHandler$CamelInjector.injectField(Field, String, String,
Object, String) line: 680	
	CamelNamespaceHandler$CamelInjector.injectFields(Object, String) line: 672	
	CamelNamespaceHandler$CamelInjector.afterInit(Object, String,
BeanProcessor$BeanCreator, BeanMetadata) line: 741	*
	BeanRecipe.runBeanProcPostInit(Object) line: 670	
	BeanRecipe.internalCreate() line: 728	
	BeanRecipe(AbstractRecipe).create() line: 64	
	RefRecipe.internalCreate() line: 60	
	RefRecipe(AbstractRecipe).create() line: 64	
	BeanRecipe.setProperty(Object, Class, String, Object) line: 813	
	BeanRecipe.setProperties(Map<String,Object>, Object, Class) line: 787	
	BeanRecipe.setProperties(Object) line: 768	
	BeanRecipe.internalCreate() line: 722	
	BeanRecipe(AbstractRecipe).create() line: 64	
	BlueprintRepository.createInstances(Collection<String>) line: 219	
	BlueprintRepository.createInstance(String) line: 198	
	BlueprintRepository.create(String) line: 137	
	BlueprintContainerImpl.getComponentInstance(String) line: 709	
	BlueprintContainerRegistry.lookup(String, Class<T>) line: 51	
	CompositeRegistry.lookup(String, Class<T>) line: 51	
	PropertyPlaceholderDelegateRegistry.lookup(String, Class<T>) line: 62	
	CamelContextHelper.lookup(CamelContext, String, Class<T>) line: 108	
	RouteBuilderDefinition.createRouteBuilder(CamelContext) line: 64	
	CamelContextFactoryBean(AbstractCamelContextFactoryBean<T>).installRoutes()
line: 624	

CamelContextFactoryBean(AbstractCamelContextFactoryBean<T>).afterPropertiesSet()
line: 276	
	CamelContextFactoryBean.afterPropertiesSet() line: 281	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	ReflectionUtils.invoke(AccessControlContext, Method, Object, Object...)
line: 225	
	BeanRecipe.invoke(Method, Object, Object...) line: 838	
	BeanRecipe.runBeanProcInit(Method, Object) line: 638	
	BeanRecipe.internalCreate() line: 726	
	BeanRecipe(AbstractRecipe).create() line: 64	
	BlueprintRepository.createInstances(Collection<String>) line: 219	
	BlueprintRepository.createInstance(String) line: 198	
	BlueprintRepository.create(String) line: 137	
	BlueprintContainerImpl.getComponentInstance(String) line: 709	

CamelNamespaceHandler$CamelDependenciesFinder.process(ComponentDefinitionRegistry)
line: 784	
	BlueprintContainerImpl.processProcessors() line: 486	
	BlueprintContainerImpl.doRun() line: 320	
	BlueprintContainerImpl.run() line: 230	
	Executors$RunnableAdapter<T>.call() line: 441	
	FutureTask$Sync.innerRun() line: 303	
	ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).run()
line: 138	

ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$301(ScheduledThreadPoolExecutor$ScheduledFutureTask)
line: 98	
	ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.run() line: 206	
	ThreadPoolExecutor$Worker.runTask(Runnable) line: 886	
	ThreadPoolExecutor$Worker.run() line: 908	
	Thread.run() line: 662	

And, when CamelContext start, all registered StartupListener was called,
before the starting of the routes...






--
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-tp5731982p5740751.html
Sent from the Camel - Users mailing list archive at Nabble.com.