Hi,
I want send a message from camel to a jms queue and then listen to the
response. I created a simple JMS MessageListener:
// listening to queue: "myQueue1"
public void onMessage(Message message) {
if (message instanceof TextMessage) {
TextMessage msg = (TextMessage) message;
try {
LOGGER.debug("replyTo: {}", msg.getJMSReplyTo());
LOGGER.debug("message: {}", msg.getText());
// process the message ...
if (message.getJMSReplyTo() != null) {
Connection conn = connectionFactory.createConnection();
Session session = conn.createSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageProducer producer =
session.createProducer(message.getJMSReplyTo());
producer.send(session.createTextMessage("my response"));
producer.close();
session.close();
conn.close();
}
} catch (JMSException e) {
LOGGER.error(e.getMessage(), e);
}
}
}
and a camel route:
<route>
<from uri="activemq:inputQueue"/>
<pipeline>
<inOut uri="activemq:myQueue1" />
<to uri="activemq:output"/>
<to uri="log:foo.bar.camel?level=INFO"/>
</pipeline>
</route>
The <inOut ... /> creates a temp queue and within the MessageListener I'm
sending back
a message to this temp queue. But I'm not sure how to process or adjust my
route in
camel ?
I get the following stacktrace:
ERROR | Failed delivery for exchangeId:
ID:mbpro-01.intra.foo.de-49689-1279271637951-2:1:1:1:1. Exhausted after
delivery attempt: 1 caught: org.apache.camel.ExchangeTimedOutException: The
OUT message was not received within: 20000 millis. Exchange[JmsMessage:
ActiveMQTextMessage {commandId = 5, responseRequired = false, messageId =
ID:mbpro-01.intra.foo.de-49689-1279271637951-2:1:1:1:1, originalDestination
= null, originalTransactionId = null, producerId =
ID:mbpro-01.intra.foo.de-49689-1279271637951-2:1:1:1, destination =
queue://inputQueue, transactionId = null, expiration = 0, timestamp =
1279271671734, arrival = 0, brokerInTime = 1279271671734, brokerOutTime =
1279271671743, correlationId = , replyTo = null, persistent = false, type =
, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null,
compressed = false, userID = null, content = null, marshalledProperties =
org.apache.activemq.util.byteseque...@270ad7c0, dataStructure = null,
redeliveryCounter = 0, size = 0, properties =
{secret=13f4b659-91ba-4ee9-9251-f9c44f957911}, readOnlyProperties = true,
readOnlyBody = true, droppable = false, text = Enter some text here for the
message body...}]
jvm 1 | org.apache.camel.ExchangeTimedOutException: The OUT message was
not received within: 20000 millis. Exchange[JmsMessage: ActiveMQTextMessage
{commandId = 5, responseRequired = false, messageId =
ID:mbpro-01.intra.foo.de-49689-1279271637951-2:1:1:1:1, originalDestination
= null, originalTransactionId = null, producerId =
ID:mbpro-01.intra.foo.de-49689-1279271637951-2:1:1:1, destination =
queue://inputQueue, transactionId = null, expiration = 0, timestamp =
1279271671734, arrival = 0, brokerInTime = 1279271671734, brokerOutTime =
1279271671743, correlationId = , replyTo = null, persistent = false, type =
, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null,
compressed = false, userID = null, content = null, marshalledProperties =
org.apache.activemq.util.byteseque...@270ad7c0, dataStructure = null,
redeliveryCounter = 0, size = 0, properties =
{secret=13f4b659-91ba-4ee9-9251-f9c44f957911}, readOnlyProperties = true,
readOnlyBody = true, droppable = false, text = Enter some text here for the
message body...}]