You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
});
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
The text was updated successfully, but these errors were encountered: