cancel
Showing results for 
Search instead for 
Did you mean: 

Set MQMD MessageID on Websphere MQ using SAP PI Receiver JMS adapter

former_member646260
Discoverer
0 Kudos

Hi,

We have a scenario (Proxy -> PI -> MQ) where we need to pass a custom value from the payload to MQMD.MsgID of Websphere MQ.

As per the below link, the JMS headers & Properties are mapped to MQ MQMD headers, in which I expect if the JMSMessageID ismapped with the custom value, that should be mapped to the MQMD MsgId.

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r1/index.jsp?topic=%2Fcom.ibm.mq.doc%2Fjm25430_.htm

We tried setting the JMS Property MessageID using the additional parameters in the JMS Receiver adapter as below, but is not reflected in the MQMD mesage ID.

I saw few blogs mentioing that it can be done by writing a custom adapter module, but no details were given on what has to be done and which property has to be set.

Can anybody who has alreaduy done this please help / comment on it.

PS: We are using SAP PI 7.11 & MQ 7

Thanks,

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Praveen,

Please check the below blog to set the JMS header and how to read that in RFHUtil tool.

regards,

Harish

former_member646260
Discoverer
0 Kudos

Hi Harish,

Thanks for your response.

The blog says how to set a custom property and use it in RHF2 header.

My requirement is precisely on the MQMD header Message ID which is the standard property of the websphere MQ.

Regards,

Praveen

former_member184720
Active Contributor
0 Kudos

Hi Praveen -

Not sure but i see that there is a method "setJMSMessageID"  available simillar to

setObjectProperty

setJMSMessageID

public void setJMSMessageID(String id)  throws JMSException
Sets the message ID. 

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received. 

Parameters: 
id - the ID of the message

Can you try with that?

If it doesn't work then i think you might have to write a module to set it using the above method.

former_member646260
Discoverer
0 Kudos

Hi Hareesh,

This also does not work.

The issue is when module SendBinarytoXIJMSService is called, PI internally calls the MQPUT method with Message option defaulted to MQPMO_NEW_MSG_ID, which generates a ramdon unique Message ID and assigned it to the JMSMessageID, irrespective of whatever value you set in it.

I think the only way is to tweak the SendBinarytoXIJMSService module to let pass the custom value in the variable JMSMessageID.

Please let me know if you are aware of where I can find com.sap.aii.af.mp.jms.ejb jar / sca, as the module SendBinarytoXIJMSService should be in that package.

thanks,

Praveen