You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ursouca <Ca...@ext.ec.europa.eu> on 2016/03/07 15:53:59 UTC
Unexpected shutdow of the Camel context
Dears,
I have a strange issue.
I have an JEE application (ear) that I deployed on a Frontend servers (2)
and Backend servers (2). The same ear is deployed on all servers and a
property file is used to activate or not the components and or camel routes
on particular servers.
I am using Camel version 2.16.2 Spring 4.2.4 and defined the routes in
Spring XML (Spring-camel):
1) route reading from direct endpoint to send a jpa endpoint to persit the
message. this message will be read by route 2) (jpa endpoint)
2) route reading from a jpa endpoint to read message to process by enriching
the message that will be sent to route 3) (direct endpoint)
3) route reading from a direct enpoint (feeded by route 2) to aggragate the
message and sending the aggegated message to a bean endpoint.
I ordered the startup of the routes to be sure that their are always
reachable.
On all server the Camel context is configured with autostatup to true in the
Spring XML context.
On the Frontend servers only route 1 is activated.
On backend servers all the three routes are activated.
Logically everything seems OK for me. But after a while (couples of days at
least 4 or 5) the we observer in the log the the context is shuting down and
there for the only route activate becomes unusable.
What can triggers the context to be shutdown?
I joinded the full configuration and I hope someone can point what parameter
is wrong or missing. Is this link to a default shutdow startegy?
CamelContext.xml
<http://camel.465427.n5.nabble.com/file/n5778699/CamelContext.xml>
Thanks in advance,
Cataldo.
--
View this message in context: http://camel.465427.n5.nabble.com/Unexpected-shutdow-of-the-Camel-context-tp5778699.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Unexpected shutdow of the Camel context
Posted by ursouca <Ca...@ext.ec.europa.eu>.
Dears,
I think I found the culprit.
I did not mentioned that in the same application,we are using also
Spring-Batch runtime (through JSR API). The Spring context of the
Spring-Batch is inheriting of a common shared context to allow the usage of
some bean in the jobs definition. But since we are using Camel (part of
share context), when a job is starts it seems to try to start again Camel
(not really a problem) but when it stops it seems ti unload its own context
and raise an 'ContextClosedEvent' event that is processed by the
CamelContext class and shutdown Camel. From this moment Camel is available
during the run of Jobs!
If somebody has this kind of configuration and it does have this kind of
issue. I am interested in their configuration. Not directly an Camel issue.
But in there is a way that Came can to filter some event base on their
source it could help.
The event looks like :
/2016-03-09 10:42:16,210|.kernel.Default (self-tuning)'|
| | | INFO
[org.springframework.batch.core.jsr.configuration.xml.JsrXmlApplicationContext:960]
Closing
org.springframework.batch.core.jsr.configuration.xml.JsrXmlApplicationContext@413a14cc:
startup date [Wed Mar 09 10:42:15 CET 2016]; parent: ApplicationContext
'baseContext'
2016-03-09 10:42:16,210|.kernel.Default (self-tuning)'|
| | |DEBUG [org.apache.camel.spring.SpringCamelContext:130]
onApplicationEvent:
*org.springframework.context.event.ContextClosedEvent[source=org.springframework.batch.core.jsr.configuration.xml.JsrXmlApplicationContext@413a14cc:
startup date [Wed Mar 09 10:42:15 CET 2016]; parent: ApplicationContext
'baseContext'] *
2016-03-09 10:42:16,211|.kernel.Default (self-tuning)'|
| | | INFO [org.apache.camel.spring.SpringCamelContext:3023]
Apache Camel 2.16.2 (CamelContext: sep-eval-camel-service) is shutting down
/
Tx,
Cataldo
--
View this message in context: http://camel.465427.n5.nabble.com/Unexpected-shutdow-of-the-Camel-context-tp5778699p5778770.html
Sent from the Camel - Users mailing list archive at Nabble.com.