On 15/02/2008, Magnus Heino <[EMAIL PROTECTED]> wrote:
> Seems like a easy thing to me, but I can't get it working.
>
> I have this:
>
> @EndpointInject(uri = "jms:queue:updateRequest")
> private ProducerTemplate<Exchange> producer;
>
> and want to send a message, and set JMSReplyTo.
>
> How do I do it?
>
> this.producer.sendBodyAndHeader("mybody, "JMSReplyTo",
> "jms:queue:updateReceipt");
>
> That doesn't work...
The easiest way is to just set the pattern on the exchange to InOut
exchange.setPattern(ExchangePattern.InOut)
and it'll use a temporary queue to do request reply.
Though if you wanna set the JMSReplyTo queue, you need to currently
set the actual JMS Destination as the header value.
I guess we could get smart - and have some kinda converter method so
that if its a String we convert it to the queue name?
So we could do something like...
producer.sendBodyAndHeader("mybody, "JMSReplyTo", "queue:updateReceipt");
> What I really want to do is listen to a jms queue, unmarshal the result with
> jaxb, forward that to a spring bean, and return the result from the spring
> bean to the jsmreplyto in the received message. Seems like a basic simple
> thing, but how? :)
Oh thats even easier :)
from("jms:myQueue").bean("myBeanName", "theMethod");
Make sure you've camel-jaxb and camel-jms on the classpath and it
should just work.
If you wanna tinker with the JAXB context you could use an explicit
unmarshal in between...
http://activemq.apache.org/camel/jaxb.html
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com