template.send() will send inOnly exchanges. What you really want to do is
template.request().

Checkout [1] and read the section about the different cases for
ExchangePattern and JMSReplyTo set or not.

[1] http://camel.apache.org/jms.html

Best,
Christian

On Fri, Mar 30, 2012 at 9:02 PM, bjacob <boneyja...@gmail.com> wrote:

> Thank you for the response.
>
> Now I'm able to send the request but on the server side(or consumer side),
> I
> see a temporary queue name and not the queue name that I'm setting to
> 'JMSReplyTo'. Other than the output not getting pushed to the correct
> queue,
> everything else seems to be fine.
>
> I'm sure that I'm missing some piece here to preserve the queue name.
>
> It would be great if some one can help me with this. I've attached my code
> below.
> --------------------------------------------------------------
>         ProducerTemplate template5 = context.createProducerTemplate();
>
>         String sendQ="ACS.OMS.ms4.13.CustomerChangedNotification.Request";
>         String readQ="ACS.OMS.ms4.13.CustomerChangedNotification.Response";
>         String
> soapAction="
> http://www.multispeak.org/Version_4.1_Release/CustomerChangedNotification
> ";
>
>         hm.put("JMSDestination",sendQ);
>         hm.put("JMSReplyTo",readQ);
>         hm.put("SoapAction", soapAction);
>
>
>         Exchange exchange = new DefaultExchange(context);
>
>         exchange.getIn().setBody(doc);
>         exchange.getIn().setHeaders(hm);
>         exchange.setPattern(ExchangePattern.InOut);
>
>         template5.send("jms:queue:"+sendQ+"?preserveMessageQos=true",
> exchange);
>
>          ConsumerTemplate consumer = context.createConsumerTemplate();
>
>
>         String msg = consumer.receiveBody("jms:queue:"+readQ,
> String.class);
>
>         System.out.println(msg);
> -----------------------------------------------------------------
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Using-Apache-Camel-ProducerTemplate-class-to-create-a-JMS-message-with-headers-and-properties-tp5607229p5607522.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to