Search code examples
springibm-mqmq

Getting MQHRF2 MQMD header instead of MQRFH2,Middleware team getting MQHRF2 instead of MQRFH2 from Spring JMS IBM MQ


I am using Spring JMS IBM MQ for connecting SAP bapi service but while sending jms messageit automatically create MQMD header as MQHRF2 instead of MQRFH2 according to middleware team which is not correct. So request you to please help in this.,I am using Spring JMS IBM MQ for connecting the SAP BAPI services so that I am sending the jms message to middleware but they are getting MQHRF2 header instead of MQRFH2. So for changing this what I have to do??? I tried to set non jms (MQSTR) but still it is sending MQHRF2 only.


Solution

  • This is one of those things the IBM MQ team did that always causes confusion with newbies.

    An 'MQRFH2' is a structure with a header and 1 or more 'folders'. It is placed in front of your message data (payload).

    The MQMessage's MD has a field called 'format' and when you have a message which contains an MQRFH2 structure, the MD's format has a value of 'MQHRF2 ' (8 chars).

    So, a properly created MQ/JMS aka (MQRFH2 message) will have the message's MD format field with a value of 'MQHRF2 '.

    Therefore, you are sending a properly formatted message - you are just getting confused because of IBM's weirdness.

    Note: They did the same thing with other internal message structures. i.e. MQIIH uses MQIMS format, MQCIH uses MQCICS format, etc.