On Tue, Dec 16, 2008 at 21:25, James Strachan <james.strac...@gmail.com>wrote:

> Just out of interest - why do you want 2 CamelContext instances? The
> idea in Camel is that there is only one per Spring XML


I am not sure on the original posters reasonings, but I have the following
scenario that has me thinking the same thing also ..

I have not thougroughly thought this through .. but (ie, i hope there is a
better way to achieve this)

   Logical seperation of routes (2 systems in one running AMQ)
        - separate config
        - separate management controls (stop/start)

In activemq.xml I can

    <import resource="path/to/camel-context.xml"/>

Now, as it turns out, we have multiple business units wanting the same AMQ
instance to "run" their flows.
Logical, yes, the team that manages Support, wants this too.

So .. what makes sense is for each of these units / flows to be isolated :
shutdown one (via jmx) and the other(s) are not affected.

Also, we want to have the configuration logically separated

<beans><!-- activemq.xml -->
    ...
    <import resource="path/to/camel-context/business-unit1.xml"/>
    <import resource="path/to/camel-context/business-unit2.xml"/>
    ...
</beans>

But .. I can't do this ..

   <camelContext ... >
        <import resource="path/to/camel-context-routes/business-unit1.xml"/>
        <import resource="path/to/camel-context-routes/business-unit2.xml"/>
   </camelContext>

because the "imported" file is itself a <beans> XML file. so each XML file
needs to have a separate context defined. *or* put another way, you can't
import a <beans> XML into / as a subset of, another <bean> defn, be it the
<camelContext>

Hope that makes it clear.
r.

Reply via email to