So, I have a message that I'm sending over an IBM mq queue and I would like to give it a customised MessageID. I've implemented DestinationResolver with the below properties in order to enable MQMD properties:
queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
I'm able to set the JMS_IBM_MQMD_ApplIdentityData
header but I'm struggling to set the JMS_IBM_MQMD_MsgId
header.
This is the MessageID I'm trying to set: String messageID = "ID:TESTYTEST";
If I set JMS_IBM_MQMD_MsgId
like this:
message.setAttribute("JMS_IBM_MQMD_MsgId", messageID.getBytes());
then I get the below error
org.apache.camel.component.jms.JmsBinding - Ignoring non primitive header: JMS_IBM_MQMD_MsgId of class: [B
However, if I set JMS_IBM_MQMD_MsgId
like this:
message.setAttribute("JMS_IBM_MQMD_MsgId", messageID);
then I get the below error
com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0051: The property 'JMS_IBM_MQMD_MsgId' should be set using type '[B', not 'java.lang.String'. JMS_IBM properties may only be set using a specific variable type. Correct application code to use the required variable type when setting this JMS_IBM property.