camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james.z.zhou" <>
Subject RE: Why I cannot run multiple CamelContext simultaneously?
Date Sat, 23 Feb 2013 15:04:23 GMT

Thank you very much for your reply! 

I tired with your suggestion, I EXPLICITLY set unique ids for the
camelContext, it is till NOT working. what I did is like this:

<camelContext xmlns="" id="camelONE" >
<camelContext xmlns="" id="camelTWO" >

I start jconsle and I found only the first *Hit*-"camelONE" shown up under

I tired another thing, the routeContext. I took as
the reference and the result made me even more confused.

I have three routes, I put two in a routeContext and one in another
routeContext. I set explicitly the unique IDs to both the routeContexts and

<beans xmlns=""

<routeContext id="oneCtx" xmlns="">
        <route id="jpaRoute">
            <to uri=""/>

        <route id="tibcoRoute"> -- I am using TibRV version 8.3
            <from uri="tibco:listen?service=xxxx&amp;network=;
            <to uri=""/>

another routeContext:

<routeContext id="twoCtx" xmlns="">
        <route id="anoterTibcoRoute">
            <from uri="tibco:listen?service=xxxx&amp;network=;
            <to uri="tibco:listen?service=xxxx&amp;network=;

The two routeContexts defined in two xml files, say routeContext1.xml and
routeContext2.xml. Then I added them into a camelContext:

<import resource="routeContext1.xml"/>
<import resource="routeContext2.xml"/>

<camelContext xmlns="">
<routeContextRef ref="oneCtx"/>
<routeContextRef ref="twoCtx"/>

After I start the appication, I can see all the three routes listed under
"Route", however, only the last *hit* route in the last *hit* routeContext, 
<route id="anoterTibcoRoute"> in this case, start doing job. If I change the
order of the two routeContexts in the camelContext, put <routeContextRef
ref="twoCtx"/> above <routeContextRef ref="oneCtx"/>, only <route
id="tibcoRoute"> start doing job.

Then I removed <routeContextRef ref="twoCtx"/> from the camelContext & just
kept <routeContextRef ref="oneCtx"/> in, I saw two routes in the jconsole
but only <route id="tibcoRoute"> start doing job, also the last *hit* one in
the routeContext.

Then, I tried with one last senario, still kept one routeContext:
<routeContextRef ref="oneCtx"/> in the camelContext, and added one route:
<route id="test">
<from uri="file://inputdir" />
<to uri="file://outputdir" />

The first time I removed  <route id="tibcoRoute">, kept <route id="test">
and <route id="jpaRoute">, both of them are working perfectly, the second
time I removed <route id="jpaRoute">, kept <route id="test"> and <route
id="tibcoRoute">, also working perfectly for both. So this proves
routeContext does support multiple routes run simultaneously. Another thing
I want to mention out is if I put <route id="jpaRoute"> and <route
id="tibcoRoute"> directly in a camelContext, both of them are working well,

Conclusion, does camel support both TibcoRV & jpa endpoints in ONE
routeContext? Anyother ideas about for my case, why multiple camelContext
cannot run simultaneously? namespace issue? conflict somewhere?



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message