camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Need help getting Camel ActiveMQComponent working in Tomcat web app
Date Sat, 19 Sep 2015 07:38:20 GMT
Your pojo class CamelSender must be created by spring so it can
trigger the dependency injection.

You may need to add a @Component or whatever the spring annotation is
to mark a class for dependency injection.

On Fri, Sep 18, 2015 at 9:24 PM, jcraw62 <jcraw62@gmail.com> wrote:
> Claus,
>
> thank you for the prompt reply. So now I understand ProducerTemplate should
> be instantiated via Spring. I've configured:
>
>     <camel:camelContext id="camel-client">
>         <camel:template id="camelTemplate"
> defaultEndpoint="activemq:start"/>
>     </camel:camelContext>
>
> and still I do not get injection when I code:
>
> @Produce(uri = "activemq:start")
>     protected ProducerTemplate template;
>     public void sendToQueue(String name, String msg) {
>         for (int i = 0; i < 3; i++) {
>             template.sendBody("activemq:queue:" + name, msg);
>         }
>     }
>
> I see my configured beans in the app context but injection seems to fail
> regardless of which bean I try to inject using different injection
> annotations.
>
> I'm still conceptually missing something.
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Need-help-getting-Camel-ActiveMQComponent-working-in-Tomcat-web-app-tp5771612p5771672.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition:
https://www.manning.com/books/camel-in-action-second-edition

Mime
View raw message