0
votes

I have a Mule flow which uses a JMS inbound endpoint - the end point is request response - when I run a test sending an ObjectMessage the request gets to the subsequent transformers and I can see the response at the end of the processing cycle.

However there is an issue when I submit a JMS request to the queue from an external Java client - the JMS message gets submitted however the response payload is always null - I am including a code snippet below of my scenario

Thanks

Solved the issue using the following Active MQ test class.

 connectionFactory = new ActiveMQConnectionFactory(connectionUri);
 connection = connectionFactory.createConnection();
 session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 replyQueue = session.createQueue("REPLY.Q");
 requestQueue = session.createQueue("REQUEST.Q");
 messageConsumer = session.createConsumer(replyQueue);
 messageConsumer.setMessageListener(this);
 connection.start();

 ObjectMessage message = session.createObjectMessage();
 message.setObject(getCompositeEntity());
 message.setJMSReplyTo(replyQueue);
 String randomStr = UUID.randomUUID().toString();
 message.setJMSCorrelationID(randomStr);
 MessageProducer publisher = session.createProducer(requestQueue);
 publisher.send(message);
1

1 Answers

0
votes

Does the JMS message you publish from an external client have its JMSReplyTo property correctly set to a queue (permanent or temporary)?