Search code examples
jmsibm-mqwso2-enterprise-integrator

WSO2: Passing NameValueCCSID and NameValueData to IBM MQ using MQRFH2 header


I'm trying to send XML messages to IBM MQ over JMS transport, using a WSO2 proxy service. I have already configured the JMS transport on server level and successfully published some messages to the queue. I can see the published messages using MQ console.

Now, I have requirement to send additional meta-data using MQRFH2 header.

I should populate the NameValueCCSID field with value 1208 and NameValueData field with an XML document in format

<COMSMS>
  <FIN_Input>
  ...

The RFH2 header should have only one NameValue COMSMS.

I already searched through IBM and WSO2 documentation but was not able to figure out how to pass data for this custom NameValue (neither NameValueCCSID nor NameValueData). The WSO2 documentation only provides examples for predefined properties which have a JMS-MQ mapping.

Thanks in advance for any help.


Solution

  • You can use standard JMS properties, they will be stored in the usr folder of RHF2 header:

    myMessage.setStringProperty("MyPropertyName", "MyPropertyValue");
    

    You can use any arbitrary String as the value, so it could also be an XML alike value - this is a matter of application design. A more fine-grained setting of separate message properties will make it easier for the receiving application to specify message selectors.

    There are also methods for properties of other data types then String available.