Hi,
I'm new to camel and i've tried to follow this example of implementation of
the EndPoint Pattern : http://camel.apache.org/tutorial-jmsremoting.html
I'm running an activeMQ on a VM. the producer & the consumer code are on
different pc.
My goal is to send an xml File from the producer to the broker, do some
operation on it and send an acknowledgment to the producer.
here is how i did it :
context = new ClassPathXmlApplicationContext("camel-client.xml");
CamelContext camel = (CamelContext) context.getBean("camel-client");
// get the endpoint from the camel context
endpoint = camel.getEndpoint("jms:topic:"+topicName);//topicName is
an argument of the java Program.
Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);
// set the input on the in body
exchange.getIn().setBody( msg ); //"msg" is the content of my xmlFile
in a String object .
// to send the exchange we need an producer to do it for us
Producer producer = endpoint.createProducer();
// start the producer so it can operate
producer.start();
producer.process(exchange);
And now i'm waiting for the answer before to stop the producer...
System.out.println("... the result is : " + exchange.getOut().getBody());
producer.stop()
I always get the TimedOutException : The OUT message was not received
within: 20000 millis. Exchange[Message: test]
and i don't understand why. The consumer code works fine, the route i
specified is working well (i.e. the message coming from the topic is
consumed in the bean of my choice).
The method that I call in my consumer returns a String "OK" or "KO",
depending on the validity of the XML file and a bunch of other stuff :)
I just don't get it, the exchange.getOut() is always null; how am I supposed
to set the response to the producer ? :/
Any help will be appreciated :)
Bertrand
--
View this message in context:
http://camel.465427.n5.nabble.com/ExchangePattern-InOut-I-Can-t-get-any-response-tp5056301p5056301.html
Sent from the Camel - Users mailing list archive at Nabble.com.