Thanks  for the explanation Claus!

regards
 marco

On Fri, Jun 8, 2012 at 4:53 AM, Claus Ibsen <[email protected]> wrote:

> The ProducerTemplate has API for sending a message to *any* Camel endpoint
>
> template.sendBody("log:blah", "Hello Log");
>
> The uri in the annotation, is just the default uri, if you do not specify
> any eg
>
> template.sendBody("Hello default channel");
>
>
> On Thu, Jun 7, 2012 at 11:36 PM, Marco Mistroni <[email protected]>
> wrote:
>
> > hi all
> >  i have a camel app in which i have exposed few JMX beans.
> >
> > I want to be able to send a message to a channel via my JMX bean.
> >
> > I have read the POJO Producing info here
> >
> > http://camel.apache.org/pojo-producing.html
> >
> > and at the moment i am doing this in my JMX bean
> >
> > @EndpointInject(uri="seda:testChannel")
> >    private ProducerTemplate producer;
> >
> >
> > However, i want to be able to send messages to different channels, not
> only
> > to the uri above.
> >
> > Ok i can always create  a  'jmx-channel' with a router for each type of
> > message.,... but i was just wondering if i can just inject a
> > ProducerTemplate without specifying the URI/
> >
> > I have tried using the  @Autowired but the bean wasn't being set
> correctly.
> > (the bean was not being set ,resulting in a NullPointerException
> whenever i
> > was invoking methods on it)
> >
> > here's my camelContext where i define the producer
> >
> >    <camel:camelContext xmlns="http://camel.apache.org/schema/spring";
> >        id="camelServer">
> >
> >        <camel:template id="producer"/>
> >
> > could anyone offer another suggestion (other than sending message to a
> > default channel associated with a router)?
> >
> > w/kindest regards
> >  marco
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [email protected]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Reply via email to