[
https://issues.apache.org/activemq/browse/CAMEL-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=53449#action_53449
]
Willem Jiang commented on CAMEL-1873:
-------------------------------------
Yes, it's a *hack* way, if we change the CamelContextAware interface, it will
effect the user's bean which implement's CamelContextAware interface.
As we working on the camel 2.0, it's a good change to add getCamelContext
method in the CamelContextAware.
Current CamelPostProcessor can see all the beans in the application context, it
is hard to tell if the CamelPostProcessor's camel context is belong to the bean.
so I add the checking in the the CamelPostProcessor to skip the camel context
injection if the bean already have the camel context to avoid the injection of
a wrong camel context.
> template , consumerTemplate, service, proxy can't be set with right camel
> context if there are more than one camel context in the spring application
> context
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-1873
> URL: https://issues.apache.org/activemq/browse/CAMEL-1873
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-spring
> Affects Versions: 1.4.0, 1.5.0, 1.6.0, 2.0-M1, 1.6.1, 2.0-M2, 2.0-M3
> Reporter: Willem Jiang
> Assignee: Willem Jiang
> Fix For: 1.6.2, 2.0.0
>
>
> Current camel support to define a producer template OUTSIDE a camel context,
> I think it works well just like the autowire function which is provided in
> Spring.
> If there more than two Camel context in the Spring Application context , the
> user should specify the camel context which the template should use.
> But I have a concern that even we put the template INSIDE the camel context,
> the template will not be set with a right version of camel context, since we
> use a CamelPostProcessor to inject CamelContext.
> So I did a quick test on the current Camel code and found there is a bug if
> there are more one CamelContext -- CamelPostProcessor will inject the last
> create camel context into the CamelContextAware object.
> Since it is not easy to add the camelContext referece id into the template
> element attribute, we'd better just support to parser these elements inside
> the camel context.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.