[
https://issues.apache.org/jira/browse/CAMEL-3563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984102#action_12984102
]
james strachan commented on CAMEL-3563:
---------------------------------------
in pure Spring / web app worlds, we can rely on the lookup by name of a
component in the local Spring ApplicationContext.
In OSGi any bundle can expose a CamelContext, so the name tends to use a bundle
prefix. We may wish to use a few different naming schemes to lookup a
CamelContext. So by default Camel already looks up a scheme as a simple name in
the local context; we can piggy back on that for non-OSGi simple web apps.
Then maybe we provide a few different OSGi naming schemes to lookup a
CamelContext (or endpoint or component). e.g. looking up via bundle ID or only
look in the local bundle or query the OSGi registry etc
> 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.