You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mike Chao <mi...@gmail.com> on 2015/05/20 01:44:00 UTC

Using CamelContextAware bean in RouteBuilder question

Hi all,

I am having a bit of problem trying to using a bean that implements
CamelContextAware in a route. The setCamelContext method on the bean is
never called. I have attached a test program. camelContextAwareTest.zip
<http://camel.465427.n5.nabble.com/file/n5767281/camelContextAwareTest.zip>  

I am using the following versions.
camel core 2.8.2
camel spring 2.8.2
camel spring java config 2.8.2
spring 3.2.0

It seems like I have to override the method camelBeanPostProcessor() from
CamelConfiguration in order for it to work. Is this kosher/the right thing
to do?

Thanks for your time
Mike



--
View this message in context: http://camel.465427.n5.nabble.com/Using-CamelContextAware-bean-in-RouteBuilder-question-tp5767281.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using CamelContextAware bean in RouteBuilder question

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, May 20, 2015 at 6:31 PM, Mike Chao <mi...@gmail.com> wrote:
> Hi Claus,
>
> Sorry, I should have tried that first. I upgraded to using 2.15.2 in my
> sample program and I do not have to override the camelBeanPostProcessor from
> CamelConfiguration in order for the setCamelContext method to be called on
> the bean that implements CamelContextAware.
>
> However I am stuck using Camel 2.8.2 at work, is override the
> camelBeanPostProcessor the right way or is there another way?
>

Yeah as that version is EOL, I think its fine to do whatever it takes
for you to get it working.

> Thanks again
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-CamelContextAware-bean-in-RouteBuilder-question-tp5767281p5767340.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Using CamelContextAware bean in RouteBuilder question

Posted by Mike Chao <mi...@gmail.com>.
Hi Claus,

Sorry, I should have tried that first. I upgraded to using 2.15.2 in my
sample program and I do not have to override the camelBeanPostProcessor from
CamelConfiguration in order for the setCamelContext method to be called on
the bean that implements CamelContextAware. 

However I am stuck using Camel 2.8.2 at work, is override the
camelBeanPostProcessor the right way or is there another way?

Thanks again



--
View this message in context: http://camel.465427.n5.nabble.com/Using-CamelContextAware-bean-in-RouteBuilder-question-tp5767281p5767340.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using CamelContextAware bean in RouteBuilder question

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

This is very old versions. Try with newer releases.

On Wed, May 20, 2015 at 1:44 AM, Mike Chao <mi...@gmail.com> wrote:
> Hi all,
>
> I am having a bit of problem trying to using a bean that implements
> CamelContextAware in a route. The setCamelContext method on the bean is
> never called. I have attached a test program. camelContextAwareTest.zip
> <http://camel.465427.n5.nabble.com/file/n5767281/camelContextAwareTest.zip>
>
> I am using the following versions.
> camel core 2.8.2
> camel spring 2.8.2
> camel spring java config 2.8.2
> spring 3.2.0
>
> It seems like I have to override the method camelBeanPostProcessor() from
> CamelConfiguration in order for it to work. Is this kosher/the right thing
> to do?
>
> Thanks for your time
> Mike
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-CamelContextAware-bean-in-RouteBuilder-question-tp5767281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/