[ 
https://issues.apache.org/jira/browse/CAMEL-3563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984215#action_12984215
 ] 

Hadrian Zbarcea commented on CAMEL-3563:
----------------------------------------

@James, I think that not having a predefined component scheme would 
unnecessarily complicate implementation and would create confusion if the 
contextId would match the one of a predefined component, such as say "cache". I 
would prefer one of the 2 alternatives:
{code}
<to uri="context:prod:direct:foo"/>
{code}
{code}
<to context="prod" uri="direct:foo"/>
{code}
After only a few minutes of thought I think I am getting slightly partial to 
the former, as having all the info in the uri in one place.

> 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