You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kovacs Zsolt <zs...@gmail.com> on 2011/07/05 12:05:49 UTC

ProducerTemplate

Hi,
 I tried to send some message to Camel endpoint from a bundle containing
only a POJO as described in
 http://camel.apache.org/pojo-producing.html but the producer template is
null,  how I can initialize?
Regards,
Zsolt

Re: ProducerTemplate

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jul 13, 2012 at 6:04 PM, ceclabaugh <ce...@gmail.com> wrote:
> Is there a non-test example of this? Does the xml context file for any route
> need to be named after its producer?
>

No you can name the XML file anything you like. That naming scheme is
just a spring test pattern.

See here
http://camel.apache.org/producertemplate.html


> --
> View this message in context: http://camel.465427.n5.nabble.com/ProducerTemplate-tp4552750p5716019.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: ProducerTemplate

Posted by ceclabaugh <ce...@gmail.com>.
Is there a non-test example of this? Does the xml context file for any route
need to be named after its producer?

--
View this message in context: http://camel.465427.n5.nabble.com/ProducerTemplate-tp4552750p5716019.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ProducerTemplate

Posted by Charles Moulliard <cm...@gmail.com>.
Here is an example from Camel project

https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/produce/ProduceTemplateTest.java

https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/produce/ProduceTemplateTest-context.xml


On Tue, Jul 5, 2011 at 1:59 PM, Kovacs Zsolt <zs...@gmail.com> wrote:
> Hi,
>  is there some complete example? because my *producer *variable null (I
> reproduced exactly what You wrote here,
>  with camelContext defined in beans.xml
> Thanks,
> Zsolt
>
>
> On Tue, Jul 5, 2011 at 12:15 PM, Charles Moulliard <cm...@gmail.com>wrote:
>
>> Hi,
>>
>> It depends if you camel Spring DSL or Java DSL
>>
>> With Spring DSL you can use the following syntax :
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>>    <!-- define a producer template -->
>>    <template id="producer"/>
>>
>> and @Autowired in your PoJo
>>
>>    @Autowired
>>    private ProducerTemplate producer;
>>
>> Regards,
>>
>> Charles Moulliard
>>
>> Apache Committer
>>
>> Blog : http://cmoulliard.blogspot.com
>> Twitter : http://twitter.com/cmoulliard
>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> Skype: cmoulliard
>>
>>
>>
>> On Tue, Jul 5, 2011 at 12:05 PM, Kovacs Zsolt <zs...@gmail.com>
>> wrote:
>> > Hi,
>> >  I tried to send some message to Camel endpoint from a bundle containing
>> > only a POJO as described in
>> >  http://camel.apache.org/pojo-producing.html but the producer template
>> is
>> > null,  how I can initialize?
>> > Regards,
>> > Zsolt
>> >
>>
>

Re: ProducerTemplate

Posted by Kovacs Zsolt <zs...@gmail.com>.
Hi,
  is there some complete example? because my *producer *variable null (I
reproduced exactly what You wrote here,
 with camelContext defined in beans.xml
Thanks,
Zsolt


On Tue, Jul 5, 2011 at 12:15 PM, Charles Moulliard <cm...@gmail.com>wrote:

> Hi,
>
> It depends if you camel Spring DSL or Java DSL
>
> With Spring DSL you can use the following syntax :
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>    <!-- define a producer template -->
>    <template id="producer"/>
>
> and @Autowired in your PoJo
>
>    @Autowired
>    private ProducerTemplate producer;
>
> Regards,
>
> Charles Moulliard
>
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>
>
>
> On Tue, Jul 5, 2011 at 12:05 PM, Kovacs Zsolt <zs...@gmail.com>
> wrote:
> > Hi,
> >  I tried to send some message to Camel endpoint from a bundle containing
> > only a POJO as described in
> >  http://camel.apache.org/pojo-producing.html but the producer template
> is
> > null,  how I can initialize?
> > Regards,
> > Zsolt
> >
>

Re: ProducerTemplate

Posted by Charles Moulliard <cm...@gmail.com>.
Hi,

It depends if you camel Spring DSL or Java DSL

With Spring DSL you can use the following syntax :

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <!-- define a producer template -->
    <template id="producer"/>

and @Autowired in your PoJo

    @Autowired
    private ProducerTemplate producer;

Regards,

Charles Moulliard

Apache Committer

Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard



On Tue, Jul 5, 2011 at 12:05 PM, Kovacs Zsolt <zs...@gmail.com> wrote:
> Hi,
>  I tried to send some message to Camel endpoint from a bundle containing
> only a POJO as described in
>  http://camel.apache.org/pojo-producing.html but the producer template is
> null,  how I can initialize?
> Regards,
> Zsolt
>