Should work. Did you EXPLICITLY specified context IDs?
If you have more than one context you can't rely on the default since all 
context would get same - and that is not possible.

Ales

-----Original Message-----
From: james.z.zhou [mailto:james.z.z...@hotmail.com] 
Sent: Wednesday, February 20, 2013 4:20 PM
To: users@camel.apache.org
Subject: Why I cannot run multiple CamelContext simultaneously?

Hi:

The story is, I have two camelContexts defined in two XML files, say 
camel-context1.xml and camel-context2.xml and I imported them to a main.xml, 
the main.xml looks like:

...
<import spring-DB.xml>
<import spring-PROCESSOR.xml>
<import spring-camel-context1.xml>
<import spring-camel-context2.xml>
</beans>

DB.xml contains DB-related bean definitions, like jpaComponent and 
PROCESSOR.xml contains the processor bean definitions.

In the Main class, I newed a Camel.Spring.Main instance:

Main main = new Main();

main.setApplicationContextUri("config/main.xml");
main.enableHangupSupport();
main.run();

In the log file, I can see all the xml files imported in main.xml are loaded 
successfully. However, only the camelContext in camel-context1 starts working, 
the camelContext in camel-context2 is not working. If I move <import 
spring-camel-context2.xml> above <import spring-camel-context1.xml>, then the 
camelContext in camel-context2 starts working, the camelContext in
camel-context1 is not working.

BTW, I am using the jar version: 2.10.0

Do you guys have any idea please?

thanks

james



--
View this message in context: 
http://camel.465427.n5.nabble.com/Why-I-cannot-run-multiple-CamelContext-simultaneously-tp5727877.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to