WebSphere MQ Suite Commit Service

The WebSphere MQ Suite Commit service is used with the other WebSphere MQ Suite services to send and receive messages from a WebSphere MQ server.

The following table provides an overview of the WebSphere MQ Suite Commit service:

Category Description
System Name WSMQCommit
Graphical Process Modeler (GPM) categories) All Services, Messaging
Description Used as part of the WebSphere MQ Suite to commit SyncPoint operations for a given WebSphere MQ Queue Manager.
Business usage Used in conjunction with the other WebSphere MQ Suite services to send and/or receive messages from a WebSphere MQ server.
Usage example Should be called after SyncPoint put and/or get operations have been performed.
Preconfigured? Yes – a default instance is created during install, which can be used by all business processes. Default instance name is WSMQ_Commit.
Requires third-party files? com.ibm.mq.jar version 5.2.0 or higher and associated message catalog property files (i.e. mqji_en_US.property). These files need to be installed using install3rdParty.
Platform availability All supported application platforms
Related services
Related services:
  • WSMQOpenSession
  • WSMQCloseSession
  • WSMQOpenQueue
  • WSMQCloseQueue
  • WSMQPutMessage
  • WSMQGetMessage
  • WSMQBackout
Application requirements You must have a WebSphere MQ server.
Initiates business processes? No. This service does not invoke business processes or process any business process documents.
Invocation Invoke the default instance in a business process and specify the appropriate parameters
Business process context considerations This service is not necessary at all if SyncPoint operations are not performed. And even though this service is not mandatory even with SyncPoint operations, because the QueueManager (on some platforms) performs the commits automatically, its use is recommended to ensure expected results. WSMQCommit has no bearing if it exists within a distributed transaction. It is ignored. The commit is done on the transaction end, so this service is not required (or used) within the business process.
Returned status values Returned status values:
  • Success – Commit was successful.
  • Error – Commit was unsuccessful.
Restrictions WSMQCommit has no bearing if it exists within a distributed transaction. It is ignored. The commit is done on the transaction end, so this service is not required (or used) within the business process.
Persistence level Default
Testing considerations While testing this service, it is recommended to turn on debugging (wsmq_debug=Yes), which provides useful information if problems occur.

Implementing the WebSphere MQ Suite Commit Service

There are no steps required for implementing this service. The default configuration, WSMQ_Commit, is ready for use as soon as the application is installed.

Configuring the WebSphere MQ Suite Commit Service

This service has no configurable parameters.

Parameters Passed From Business Process to Service

The following table contains the parameters passed from the business process to the WebSphere MQ Suite Commit service:

Parameter Description
wsmq_sessionid The session identifier to use from a previously established session. Valid value is the value from a previously opened session. Required.

Parameters Passed From Service to Business Process

The following table contains the parameters passed from the WebSphere MQ Suite Commit service to the business process:

Parameter Description
WSMQ/CompletionCode Only set if an MQException occurs and indicates the completion code.
WSMQ/ReasonCode Only set if an MQException occurs and indicates the reason code.

Business Process Example

The following example illustrates how the WebSphere MQ Suite Commit service can be used in a business process:

<process name = "PUTexample">  
  <sequence name="OpenSession"> 
   <operation name="Open Session"> 
     <participant name="WSMQ_OpenSession"/> 
     <output message="toService"> 
       <assign to="." from="*"/> 
        <assign to="wsmq_hostname">some_host_name</assign> 
       <assign to="wsmq_channel">some_channel_name</assign> 
       <!-- <assign to="wsmq_debug">Yes</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="wsmq_sessionid" from="string(wsmq_sessionid)"/> 
         <assign to="wsmq_qname">some_queue_name</assign> 
         <assign to="wsmq_MQOO_type">PUT</assign> 
         <assign to="wsmq_MQOO_failifquiescing">Yes</assign> 
       </output> 
        <input message="fromService"/> 
     </operation> 
 
     <operation name="PUT message(s)"> 
       <participant name="WSMQ_PutMessage"/> 
       <output message="toService"> 
         <assign to="." from="*"/> 
         <assign to="wsmq_qname">some_queue_name</assign> 
<!-- If neither two following assign's are specified, 
     the PrimaryDocument will be sent 
OR to perform batch sending, use the following assign: 
          <assign to="wsmq_batchFilter">*</assign> 
OR to send some other single document, use the following assign: 
         <assign to="wsmq_document" from="SomeDocumentName/@*"/> 
--> 
       </output> 
        <input message="fromService"> 
         <assign to="." from="*"/> 
       </input> 
      </operation> 
 
     <operation name="Commit the PUT"> 
       <participant name="WSMQ_Commit"/> 
       <output message="toService"> 
         <assign to="wsmq_sessionid" from="string(wsmq_sessionid)"/> 
       </output> 
        <input message="fromService"/> 
     </operation> 
 
     <operation name="Close Queue"> 
       <participant name="WSMQ_CloseQueue"/> 
       <output message="toService"> 
         <assign to="wsmq_sessionid" from="string(wsmq_sessionid)"/> 
         <assign to="wsmq_qname">some_queue_name</assign> 
       </output> 
        <input message="fromService"/> 
     </operation> 
 
     <sequence name="CloseSession"> 
       <operation name="Close Session"> 
         <participant name="WSMQ_CloseSession"/> 
         <output message="toService"> 
           <assign to="." from="*"/> <!—wsmq_sessionid passed by default --> 
          </output> 
         <input message="fromService"/> 
       </operation> 
      </sequence> 
 
     <onFault> 
        <operation name="Make sure session is closed"> 
          <participant name="WSMQ_CloseSession"/> 
          <output message="toService"> 
            <assign to="wsmq_sessionid" from="string(wsmq_sessionid)"/> 
         </output> 
          <input message="fromService"/> 
        </operation> 
     </onFault> 
    </sequence> <!-- end of SessionOpened sequence --> 
  </sequence> <!-- end of OpenSession sequence -->   
</process>