On Fri, Feb 15, 2008 at 12:28 PM, James Strachan <[EMAIL PROTECTED]>
wrote:
> 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.
>
How do I do this using the producer above? Where do I get hold of this
exchange? Please be explicit, I just don't get this :-P
>
> 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.
Ok, thats actually how I'm doing it. But right now the response is sent
nowhere, but then I just need to set this exchange pattern then I guess..
somehow..
Thanks,
/Magnus