[ 
https://issues.apache.org/jira/browse/CAMEL-3563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-3563.
--------------------------------

    Resolution: Fixed
      Assignee: james strachan  (was: Ashwin Karpe)

Ashwin, James is already working on this. I am closing this one.

> 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
>            Assignee: james strachan
>             Fix For: 2.7.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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to