camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-1663) Spring BeanPostProcessors do not work on beans which are used in Camel route builders
Date Wed, 03 Jun 2009 06:27:51 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52025#action_52025
] 

Claus Ibsen commented on CAMEL-1663:
------------------------------------

Okay finally looks like I am on track now.

Spring is really a bit odd, as it disable post processing if you use its application context
to lookup certain beans.
That ended up in a circular reference as CamelContext automatic creates a CamelBeanPostProcessor,
and the CamelBeanPostProcessor have a reference to the CamelContext it belongs to. And as
this id done while Spring namespace handler creates the CamelContext it regard it as a circular
reference. And then the ballpark for post processors changes. And that looks like the case
for the Autowired and other post processors for the @annotation stuff do not kick in.

To remedy this problem I use a reference to the CamelContext bean id from the CamelBeanPostProcessor
(just a String) then we do not have a circular reference.

As I got a bit of experiment code I need to work a bit more on it to get a polished and working
solution.
With the current code however I got both Spring and Camel to be happy and have their post
processors work side by side and being able to setup all the @annotations people insert on
their POJO classes and the Camel RouteBuilders as well.




> Spring BeanPostProcessors do not work on beans which are used in Camel route builders

> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1663
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1663
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 1.6.0, 2.0-M1
>            Reporter: Martin Gilday
>            Assignee: Claus Ibsen
>         Attachments: camel-1663.zip
>
>
> Spring PostProcessors stop working for beans which are injected into Camel route builders.
 See attached test cases showing processor breaks as soon as injected into a route builder.

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


Mime
View raw message