WebSphereMQ Suite Open Queue Service

The WebSphereMQ Suite Open Queue service is used as part of the WebSphereMQ Suite to open a queue.

The following table provides an overview of the WebSphereMQ Suite Open Queue service:

Category Description
System Name WSMQOpenQueue
Graphical Process Modeler (GPM) categories) All Services, Messaging
Description Used as part of the WebSphereMQ Suite to open a queue.
Business usage Used in conjunction with the other WebSphereMQ Suite services to send and/or receive messages from a WebSphereMQ server.
Usage example Must be called before any puts or gets can be performed.
Preconfigured? Yes – a default instance is created during install, which can be used by all business processes. Default instance name is WSMQ_OpenQueue.
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 Sterling B2B Integrator platforms
Related services
Related services:
  • WSMQOpenSession
  • WSMQCloseSession
  • WSMQCloseQueue
  • WSMQPutMessage
  • WSMQGetMessage
  • WSMQCommit
  • WSMQBackout
Application requirements You must have a WebSphereMQ 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 Must be called before any puts or gets can be performed.
Returned status values Returned status values:
  • Success – Queue opened successfully.
  • Error – Queue failed to open; check configuration options.
Restrictions None
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 WebSphereMQ Suite Open Queue Service

There are no steps required for implementing this service. The default configuration, WSMQ_OpenQueue, is ready for use as soon as Sterling B2B Integrator is installed. However, you can edit the service's parameter settings for specific business processes in the GPM.

Setting Up the Service in the GPM

Use the field definitions in the following table to set up the service configuration in the GPM:

Field Description
Config Select the name of the service configuration from the list.
Error Status For MQException (wsmq_errorOnMQException) Normally when an MQException occurs, the workflow status is set to error but this allows it to be set to success so that the workflow can perform its own error process or retry logic. Optional. Valid values are Yes and No. Default is Yes.
Binding Options (wsmq_MQOO_binding) These options apply when the queue being opened is a cluster queue. Optional. Valid values are:
  • MQOO_BIND_AS_Q_DEF (ASQDEF) (default)
  • MQOO_BIND_ON_OPEN (ONOPEN)
  • MQOO_BIND_NOT_FIXED (NOTFIXED)
Context Options (wsmq_MQOO_context) These options control the processing of message context. Optional. Valid values are:
  • No context setting (NONE) (default)
  • MQOO_SET_IDENTITY_CONTEXT (IDCTX)
  • MQOO_SET_ALL_CONTEXT (ALLCTX)
MQOO_FAIL_IF_QUIESCING? (wsmq_MQOO_failifquiescing) Indicates whether or not to include the MQOO_FAIL_IF_QUIESCING Open Option. Optional. Valid values are Yes and No. Default is Yes.
Queue open options (wsmq_type) Specifies how the queue should be opened and for what type of operations will be performed. Required. No default. Valid values are:
  • Open queue to put messages (PUT)
  • Open queue to get messages (GET)
  • Open queue to browse and/or get messages (BROWSE)
  • Open queue to put and get messages (PUTGET)
  • Open queue to put, get or browse messages (PUTBROWSE)
Queue Name (wsmq_qname) The name of the queue to open. Required. Valid value is alphanumeric. No default.

Parameters Passed From Business Process to Service

The following table contains the parameters passed from the business process to the WebSphereMQ Suite Open Queue service:

Parameter Description
All GPM parameters See Setting Up the Service in the GPM.
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 WebSphereMQ Suite Open Queue 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 WebSphereMQ Suite Open Queue 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> 
       </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>