Found the problem, classpath issues/camel version. Got it working. /S
Sigmund wrote: > > Either way I try I get a class cast exception on the client side.. > > Client > Long cryptoSendingId = (Long) producer.sendBody("jms:encryptQueue", > cryptoSending); > > implementing Processor on the server side and using this impl. also gives > class cast exc. > > public void process(Exchange exchange) throws Exception { > log.debug("process"); > Message out = exchange.getOut(true); > out.setBody(new Long(1L)); // test > } > > In the case below I guess the return type must match the argument passed > to the method? > > @MessageDriven(uri = "jms:encryptQueue") > public Long encrypt(CryptoSending cryptoSending) { > log.debug("encrypt"); > return new Long(1L); > } > > /S > > > Sigmund wrote: >> >> Hmm, tries just that before. I'll give it a try again. >> >> Thanks >> >> /S >> >> >> James.Strachan wrote: >>> >>> On 04/02/2008, Sigmund <[EMAIL PROTECTED]> wrote: >>>> >>>> I can manage with synchronous, but how do I set the response to be sent >>>> back? >>> >>> So the ProducerTemplate is the client side; it sends the request and >>> receives the response. >>> >>> Its the server side which takes the request object and sets the >>> response. To implement the server side in Camel you'd use a route. >>> >>> from("jms:someQueue").process(new Processor() { >>> public void process(Exchange exchange) { >>> Message out = exchange.getOut(true); >>> out.setBody(someResponseObject); >>> } >>> }; >>> >>> or even easier is to use a Java bean method... >>> >>> public class Foo { >>> >>> @MessageDriven(uri="jms:someQueue") >>> public String getResponse(String request) {...} >>> } >>> >>> See >>> http://activemq.apache.org/camel/bean-integration.html >>> >>> -- >>> James >>> ------- >>> http://macstrac.blogspot.com/ >>> >>> Open Source Integration >>> http://open.iona.com >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Async-request-response-using-producerTemplate-tp15117797s22882p15332220.html Sent from the Camel - Users mailing list archive at Nabble.com.