CamelContext should act like a Component (i.e. a TypeConverter of CamelContext 
-> CamelContextComponent)
--------------------------------------------------------------------------------------------------------

                 Key: CAMEL-3563
                 URL: https://issues.apache.org/jira/browse/CAMEL-3563
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: james strachan
             Fix For: 2.6.0


Imagine you have a camelContext.xml for production use (e.g. you're creating an 
OSGi bundle with a camelContext.xml) but you want to create an integration test 
case that tests out your route.

So you want to create a new Camel XML file, testCamel.xml which includes the 
camelContext.xml and interacts with it. You now have 2 camelContexts. The test 
route needs to be able to refer to any endpoints inside the other 
camelContext.xml.

CamelContext has an ID (by default camelContext IIRC).

so if we have 

camelContext.xml
{code}
<camelContext id="prod" ...>
  <route> 
    <from uri="direct:foo">
     ...

{code}


testCamelContext.xml
{code}
<camelContext id="test" ...>
  <route> 
    <from uri="direct:start">
    <to uri="prod:direct:foo"/>
   </route>
  <route> 
    <from uri="prod:seda:bar">
    <to uri="mock:results"/>
   </route>
{code}

i.e. in the test case we are routing from our local CamelContext into the 
production camel context's "direct:start" endpoint and consuming from its 
"seda:bar" endpoint.

i.e. we use "prod" as a name, look it up in the IoC context (just like any 
other Component), but if its a CamelContext we (via TypeConverters) turn it 
into a Component that resolves the rest of the name


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to