jmsTemplate.sendAndReceive("Queue2", session -> {
TextMessage msg = session.createTextMessage();
msg.setText(message);
msg.setJMSReplyTo(config.getReplyQ()); //Not updated but auto generated queue updated
msg.setJMSCorrelationID("asd_123584_lkj"); //Updated in Destination Queue
msg.setJMSType("MQSTR");
System.out.println("Message : "+msg);
return msg;
});
public Destination getReplyQ() throws JMSException {
MQQueue replyToQ = new MQQueue(queueManager, replyQueue);
Destination replyTo = (Destination) replyToQ;
return replyTo;
}
I read some articles that says using JMS will update the RFH but not MQMD and this Reply-To Queue is part of MQMD and I didn't find the right class to update the MQMD header and send the message to MQ and update the reply-to queue.