IBM Support

How to setup a Service Integration Bus to send an MQRFH2 back through WebSphere MQ

Question & Answer


Question

You are using WebSphere® MQ as a transport layer between all Service Integrations Buses of WebSphere Application Server platforms (Mainframe, other UNIX® or Linux® apps, other WebSphere Application Server Cells). You have a configuration question on how to setup the SIBus to send an MQRFH2 back through MQ to the ReplyToQueue of certain messages: If a WebSphere Application Server application is configured to accept an MQRFH2 in a Request/Reply message scenario, that message can be sent back to the ReplyToQueue using the same path it came in on. However, how do you send an MQRFH2 header back to the ReplyToQueue using this method? Keep in mind that the same path may be used for messages where the MQRFH2 cannot be sent back (mainframe application for example).

Cause

MQRFH2 is not included in WebSphere Application Server Service Integration Bus code. Further customization required by the user is missing.

Answer

The only mechanism available to cause a bus destination to automatically add an RFH2 header containing the JMS message properties is the _MQRFH2Allowed context property on the destination (which defaults to the context property on the foreign bus if no foreign/alias destinations are configured).                                          
                                                                   
With this in mind, one option might be to configure an alias destination with a similar name to the real WMQ Destination.           
                                                                   
This would require customization of the destination returned from getReplyTo to choose the right alias, using the com.ibm.websphere.sib.api.jms package. Here is an example of how you might build a SIBus queue object from the JMSReplyTo field:                                                  
JmsQueue replyToQueue = JmsFactoryFactory.newInstance().createQueue(msg.getReplyTo().toString()); 

The methods of the JmsQueue interface are described here: JmsQueue Interface                                         
If the range of queue names is large, then configuring a second foreign bus might be a better option, setting different destination defaults on the two foreign buses (one with _MQRFH2Allowed=true and the other with _MQRFH2Allowed=false). This would avoid defining any alias destinations, and mean just changing the bus name on the replyToQueue as appropriate.       

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"Service Integration Technology","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.5;8.0;7.0;","Edition":"Advanced","Line of Business":{"code":"LOB45","label":"Automation"}},{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF011","label":"HPE NonStop"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF030","label":"TRU64 UNIX"},{"code":"PF033","label":"Windows"}],"Version":"9.x,8.0,7.5,6.0","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 October 2019

UID

swg21396144