camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agentalpha <>
Subject ActiveMQ InOut JMS messaging with external system
Date Thu, 16 Oct 2014 14:41:52 GMT
Hi Everyone,

I have a route where the final destination is:

In another route I have following configuration:
<route id="soapReqQToResQ">
		<from uri="activemq:queue:soapRequestQ"/>
		<process ref="headerProcessor"/>
		<process ref="openAPISimulator"/>

Using this configuration, the activemq inout messaging works perfectly fine
and I can achieve non blocking http request-response kind of behaviour using

But when I try to do what second route is doing using a stand along activemq
java client, the inout message times out after configured time for not
getting any response. This is my java client part of code:
MessageConsumer consumer = session.createConsumer(request);// where request
is soapRequestQ
MessageProducer producer = session.createProducer(response);// where
response is responseQ

Message message = consumer.receive(1000);
if(message2 != null) {
				ActiveMQMapMessage activeMQMapMessage = (ActiveMQMapMessage) message;
				Map content = activeMQMapMessage.getContentMap();
				System.out.println("Received Message soapRequestQ: " + content);
				Map response = new HashMap();
				response.put("returnCode", "0");
				response.put("errorKey", "SUCCESS");
				try {
				// Convert Map to byte array
			    ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
			    ObjectOutputStream out = new ObjectOutputStream(byteOut);
				ByteSequence byteSequence = new ByteSequence(byteOut.toByteArray());
				ActiveMQMapMessage responseMapMessage = new ActiveMQMapMessage();
				} catch (IOException e) {
					// TODO Auto-generated catch block

I can see the message in responseQ. But it is not pickedup by camel for
InOut response.
Am I missing anything?
How the request-response in InOut pattern is connected? How does Camel auto
connects request and response in jms? I thought that JMSCorelationId was
enough for that. But it doesn't seems to be that way.
Please advice.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message