MQRFH2 Service

The MQRFH2 service adds the MQ Rules and Formatting Header 2 to the beginning of the primary document, which passes the JMS header information through WebSphereMQ.

The MQRFH2 service passes JMS header information through WebSphereMQ.

Category Description
System Name MQRFH2
Graphical Process Modeler (GPM) categories) Messaging, All
Description Adds the MQ Rules and Formatting Header 2 to the beginning of the primary document.
Business usage Passes JMS header information through WebSphereMQ.
Usage example Invoke this service before calling the WebSphereMQ Adapter or WebSphereMQ Suite.
Preconfigured? No
Requires third-party files? Requires the jars that are required by the WebSphereMQ Adapter/Suite (com.ibm.mq.jar).
Platform availability All supported Sterling B2B Integrator platforms
Related services WebSphereMQ Adapter or WebSphereMQ Suite.
Application requirements None
Initiates business processes? This service does not perform any bootstrapping.
Invocation Create an instance of this service and invoke it in a business process.
Business process context considerations This service looks for the following information in process data in order to build the MQRFH2: <ProcessData> <RFH2> <mcd>....</mcd> <jms>....</jms> <usr>....</usr> <mqext>....</mqext> </RFH2> </ProcessData> All of the above folders (mcd, jms, usr, mqext) are optional. Only specify the ones you want to use. If no folders are found, the following is used:<mcd><Msd>none</Msd></mcd>

The following link contains information regarding the various folders:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/aq06920_.htm  

For the WebSphereMQ Server to properly handle messages with MQRFH2, the MQMD.format field must be set to MQFMT_RF_HEADER_2 (‘MQHRF2 ‘). Use the following parameter to set this for:
  • WebSphereMQ Adapter:

    <assign to=”snd_MQMD_format” from=”'MQHRF2 ‘”/>

  • WebSphereMQ Suite (PutMessage):
<assign to=”wsmq_MQMD_format” from=”'MQHRF2 ‘”/>
Returned status values Returned status values:
  • Success: The service completed successfully.
  • Error: The service failed with an error.
Restrictions None
Testing considerations No special considerations for testing/debugging. This service does not currently log any debug messages.

Implementing the MQRFH2 Service

To implement the MQRFH2 service, complete the following tasks:
  1. Create a configuration of the MQRFH2 service. See Managing Services and Adapters.
  2. Specify field settings for the service configuration in the GPM as necessary.
  3. Use the service in a business process.

Configuring the MQRFH2 Service

You must create a configuration of the service in the Admin Console, then specify field settings for the new configuration of the service in the GPM. The following table contains the parameters available for the service configuration in the GPM:

Field Description
Config Select the name of the service configuration from the list.
mqrfh2_msgFormat Format name of the message payload data. Valid value is Any valid format type (see MQ manual). Default value is MQFMT_STRING. Optional.
mqrfh2_buffersize Buffer size used for reading the PrimaryDocument. Default is 5120. Optional.
mqrfh2_addFolderLen Adds four bytes per folder to the length field of the RFH header. Default is False. Optional. The following is an example use of this service:
<operation name="MQRFH2">
  <participant name="MQRFH2"/>
  <output message="MQRFH2InputMessage">
    <assign to="." from="*"></assign>
    <assign to="mqrfh2_addFolderLen">
        true
  </assign>
  </output>
  <input message="inmsg">
    <assign to="." from="*"></assign>
  </input>
</operation>

Business Process Example

The following example illustrates how the MQRFH2 service can be used in a business process:

<process name="MQRFH2test"> 
 <sequence> 
    <assign to="RFH2/mcd" from="<mcd><Msd>none</Msd></mcd>"/> 
   <operation name="MQRFH2 test"> 
      <participant name="MQRFH2"/> 
      <output message="toService"><assign to="." from="*"/></output> 
      <input message="fromService"><assign to="." from="*"/></input> 
    </operation> 
    <operation name="Open Session"> 
      <participant name="WSMQ_OpenSession"/> 
     <output message="toService"> 
       <assign to="wsmq_hostname">someMQhost</assign> 
       <assign to="wsmq_channel">someChannel</assign> 
     </output> 
      <input message="fromService"><assign to="." from="*"/></input> 
    </operation> 
   <sequence name="SessionOpened"> 
   <operation name="Open Queue"> 
   <participant name="WSMQ_OpenQueue"/> 
       <output message="toService"> 
        <assign to="." from="*"/> 
        <assign to="wsmq_qname">queueName</assign> 
        <assign to="wsmq_MQOO_type">PUT</assign> 
        <assign to="wsmq_MQOO_failifquiescing">Yes</assign> 
       </output> 
        <input message="fromService"/> 
     </operation> 
      <operation name="Put Message"> 
        <participant name="WSMQ_PutMessage"/> 
       <output message="toService"> 
        <assign to="." from="*"/> 
        <assign to="wsmq_qname">queueName</assign> 
        <assign to="wsmq_MQMD_format" from=”'MQHRF2  ‘”/> 
       </output> 
        <input message="fromService"><assign to="." from="*"/></input> 
      </operation> 
     <operation name="Commit the PUT"> 
       <participant name="WSMQ_Commit"/> 
       <output message="toService"><assign to="." from="*"/></output> 
       <input message="fromService"><assign to="." from="*"/></input> 
     </operation> 
      <sequence name="CloseSession"> 
       <operation name="Close Session"> 
         <participant name="WSMQ_CloseSession"/> 
         <output message="toService"><assign to="." from="*"/></output> 
         <input message="fromService"/> 
       </operation> 
      </sequence> <!-- end of CloseSession sequence --> 
     <onFault> 
        <operation name="Make sure session is closed"> 
          <participant name="WSMQ_CloseSession"/> 
          <output message="toService"><assign to="." from="*"/></output> 
         <input message="fromService"/> 
       </operation> 
      </onFault> 
   </sequence> <!-- end of SessionOpened sequence --> 
 </sequence> 
</process>