You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Glen Mazza <gl...@gmail.com> on 2010/09/07 00:41:27 UTC

where to attach the JMS options

Hello, for the JMS Component, where do I place the options[1] (those 
settings after the "?") -- within the from("jms:FOO.BAR?options...") of 
the route or within the Template.sendBody("jms:FOO.BAR?options...") or 
both places or does it depend on the option I'm setting?

For example, to add jmsMessageType=Object, I see it could go in two 
places but am not sure which one is correct:

      ProducerTemplate template = context.createProducerTemplate();
      MyObject myObj = new MyObject();
      
template.sendBody("jms:queue:numbersToDouble2?jmsMessageType=Object", 
myObj);


and/or, within the route:

      from("jms:queue:numbersToDouble2?jmsMessageType=Object")
      .marshal(jaxbFormat)
      .to(....), etc.


Thanks,
Glen

[1] http://camel.apache.org/jms.html#JMS-Options

Re: where to attach the JMS options

Posted by Claus Ibsen <cl...@gmail.com>.
Its used by the producer to indicate which JMS type to send the
message as. So you need it on the producer side only.



On Tue, Sep 7, 2010 at 12:41 AM, Glen Mazza <gl...@gmail.com> wrote:
> Hello, for the JMS Component, where do I place the options[1] (those
> settings after the "?") -- within the from("jms:FOO.BAR?options...") of the
> route or within the Template.sendBody("jms:FOO.BAR?options...") or both
> places or does it depend on the option I'm setting?
>
> For example, to add jmsMessageType=Object, I see it could go in two places
> but am not sure which one is correct:
>
>     ProducerTemplate template = context.createProducerTemplate();
>     MyObject myObj = new MyObject();
>     template.sendBody("jms:queue:numbersToDouble2?jmsMessageType=Object",
> myObj);
>
>
> and/or, within the route:
>
>     from("jms:queue:numbersToDouble2?jmsMessageType=Object")
>     .marshal(jaxbFormat)
>     .to(....), etc.
>
>
> Thanks,
> Glen
>
> [1] http://camel.apache.org/jms.html#JMS-Options
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: where to attach the JMS options

Posted by Willem Jiang <wi...@gmail.com>.
Hi Glen,

Glen Mazza wrote:
> Hello, for the JMS Component, where do I place the options[1] (those 
> settings after the "?") -- within the from("jms:FOO.BAR?options...") of 
> the route or within the Template.sendBody("jms:FOO.BAR?options...") or 
> both places or does it depend on the option I'm setting?
You need to place the option into these two place.
As these two endpoint will create a producer and a consumer separately.

> 
> For example, to add jmsMessageType=Object, I see it could go in two 
> places but am not sure which one is correct:
> 
>      ProducerTemplate template = context.createProducerTemplate();
>      MyObject myObj = new MyObject();
>      
> template.sendBody("jms:queue:numbersToDouble2?jmsMessageType=Object", 
> myObj);
> 
> 
> and/or, within the route:
> 
>      from("jms:queue:numbersToDouble2?jmsMessageType=Object")
>      .marshal(jaxbFormat)
>      .to(....), etc.
> 
> 
> Thanks,
> Glen
> 
> [1] http://camel.apache.org/jms.html#JMS-Options
> 

Willem