Closed doppiak closed 4 years ago
There's probably quite a few ways to do this, depending on how you are writing the rest of the JMS code. This Spring Boot component itself doesn't mandate how you create messages or destinations - it only really helps with the ConnectionFactory setup. But given that a lot of Spring Framework samples use the simple JmsTemplate class, then this may work for you, using a MessagePostProcessor:
jmsTemplate.convertAndSend(qName, inputMsg, ppMsg -> {
MQDestination dest = new MQDestination(qName);
dest.setMessageBodyStyle(WMQConstants.WMQ_MESSAGE_BODY_MQ);
ppMsg.setJMSDestination(dest);
if (ppMsg instanceof TextMessage) {
ppMsg.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 37);
}
return ppMsg;
});
answered. no additional followup.
Is it possible to set messageBodyStyle and customizing TextMessage (setting WMQConstants.JMS_IBM_CHARACTER_SET)? How?
Using javax.jms I can do: ((MQDestination) sender.getDestination()).setMessageBodyStyle(WMQConstants.WMQ_MESSAGE_BODY_MQ);
and I can customize TextMessage like this:
final TextMessage msg = session.createTextMessage(); msg.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, 37);
Thank you