WebSphereMQ Suite Put Message Service
The WebSphereMQ Suite Put Message service is used as part of the WebSphereMQ Suite to open a queue.
The following table provides an overview of the WebSphereMQ Suite Put Message service:
Category | Description |
---|---|
System Name | WSMQPutMessage |
Graphical Process Modeler (GPM) categories) | All Services, Messaging |
Description | Used as part of the WebSphereMQ Suite to put messages on a queue. |
Business usage | Used with the other WebSphereMQ Suite services to send or receive messages from a WebSphereMQ server. |
Usage example | Used to “put” messages on a queue. |
Preconfigured? | Yes – a default instance is created during install, which can be used by all business processes. Default instance name is WSMQ_PutMessage. |
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:
|
Application requirements | You must have a WebSphereMQ server. |
Initiates business processes? | No. This service does not invoke business processes. |
Invocation | Invoke the default instance in a business process and specify the appropriate parameters. |
Business process context considerations | To send a single workflow document, assign a document to the wsmq_document parameter, otherwise it defaults to use primary document. Sending multiple documents from process data can be accomplished by specifying wsmq_batchFilter. |
Returned status values | Returned status values:
|
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 Put Message Service
There are no steps required for implementing this service. The default configuration, WSMQ_PutMessage, 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. |
Batch mode document filter (wsmq_batchFilter) | If specified, indicates batch mode sending of workflow documents. Enter an asterisk (*) for all documents including Primary Document. Any value is valid. Optional. |
Buffersize override (wsmq_buffersize) | If specified, overrides the default buffersize used when streaming data. Valid values are 0-999999999. Optional. |
Document tracking (wsmq_docTracking) | Specifies whether to perform document tracking. Valid values are Yes and No. Default is No. Optional. |
Document to PUT (wsmq_document) | Specifies a single workflow document. Valid value is a valid workflow document. Optional. |
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. Valid values are Yes and No. Default is Yes. Optional. |
Convert wsmq_MQMD_accountingToken from hex to byte array (wsmq_hexToByte_actToken) | Select Yes to invoke the conversion from hex to byte array. Valid values are Yes and No. Default is No. Optional. |
Convert wsmq_MQMD_correlId from hex to byte array (wsmq_hexToByte_corId) | Select Yes to invoke the conversion from hex to byte array. Valid values are Yes and No. Default is No. Optional. |
Convert wsmq_MQMD_groupId from hex to byte array (wsmq_hexToByte_grpId) | Select Yes to invoke the conversion from hex to byte array. Valid values are Yes and No. Default is No. Optional. |
Convert wsmq_MQMD_msgId from hex to byte array (wsmq_hexToByte_msgId) | Select Yes to invoke the conversion from hex to byte array. Valid values are Yes and No. Default is No. Optional. |
Maximum message size (wsmq_maxMsgSize) | Used to limit the message size. Documents larger than the maxMsgSize will be segmented. Valid values are 0-9999999999. Default is zero (0). Optional. |
Accounting Token (wsmq_MQMD_accountingToken) | Used to set the accounting token field of the message descriptor (MQMD). Any value is valid. Optional. |
Application Identity Data (wsmq_MQMD_applicationIdData) | Used to set the application identity data field of the message descriptor (MQMD). Any value is valid. Optional. |
Application Origin Data (wsmq_MQMD_applicationOriginData) | Used to set the application origin data field of the message descriptor (MQMD). Any value is valid. Optional. |
Character Set (wsmq_MQMD_charset) | Used to set the character set field of the message descriptor (MQMD). Valid value is a valid character set identifier as defined by the MQ documentation. Default is MQCCSI_Q_MGR, character set 819 (iso-8859-1/latin1/ibm819). Optional. |
Correlation Identifier (wsmq_MQMD_corId) | Used to set the correlation identifier field of the message descriptor (MQMD). Any value is valid. Default is MQCI_NONE. Optional. |
Expiration Time Out (1/10 sec) (wsmq_MQMD_expiry) | Used to set the expiry field of the message descriptor (MQMD). Valid values are 0-9999999999. If zero is specified, the default, MQEI_UNLIMITED, is used. Optional. |
Report feedback or reason code (wsmq_MQMD_feedback) | Used to set the feedback field of the message descriptor (MQMD). The feedback field is only set if wsmq_MQMD_msgType is REPORT. Valid value is feedback or reason code value (see your MQ documentation for more information about codes). Default is MQFB_NONE. Optional. |
Format (wsmq_MQMD_format) | Used to set the format field of the message descriptor (MQMD). Valid value is any valid format type (see your MQ documentation for more information about format types). Default is MQSTR. Optional. |
Group Identifier (wsmq_MQMD_grpId) | Used to set the group identifier field of the message descriptor (MQMD). Any value is valid. Default is MQGI_NONE. Optional. |
Message Identifier (wsmq_MQMD_msgId) | Used to set the message identifier field of the message descriptor (MQMD). Any value is valid. Default is MQMI_NONE. Optional. |
Message Sequence Number (wsmq_MQMD_msgSeqNumber) | Used to set the message sequence number field of the message descriptor (MQMD). Valid values are 1-999999999. Optional. |
Message Type (wsmq_MQMD_msgType) | Used to set the message type field of the message
descriptor (MQMD). Optional. Valid values are:
|
Message Offset (wsmq_MQMD_offset) | Used to set the message offset field of the message descriptor (MQMD). Valid values are 0-999999999. Optional. |
Message Persistence (wsmq_MQMD_persistence) | Used to set the message persistence field of the
message descriptor (MQMD). Optional. Valid values are:
|
Priority (wsmq_MQMD_priority) | Used to set the priority field of the message descriptor (MQMD). Optional. Valid values are 0-9. Default is MQPRI_PRIORITY_AS_Q_DEF. |
Put Application Name (wsmq_MQMD_putApplName) | Used to set the put application name field of the message descriptor (MQMD). Any value is valid. Optional. |
Put Application Type (wsmq_MQMD_putApplType) | Used to set the put application type field of the message descriptor (MQMD). Valid value is a valid PutApplicationType value. Optional. |
Reply To Queue (wsmq_MQMD_replyToQ) | Used to set the reply to queue field of the message descriptor (MQMD). Any value is valid. Optional. |
Reply To Queue Manager (wsmq_MQMD_replyToQM) | Used to set the reply to queue manager field of the message descriptor (MQMD). Any value is valid. Optional. |
MQMF_LAST_MSG_IN_GROUP (wsmq_MQMF_lastMsgInGroup) | Used to add the MQMF_LAST_MSG_IN_GROUP Message Flag option of the message descriptor (MQMD). Valid values are Yes and No. Default is No. Optional. |
MQMF_MSG_IN_GROUP (wsmq_MQMF_msgInGroup) | Used to add the MQMF_MSG_IN_GROUP Message Flag option of the message descriptor (MQMD). Valid values are Yes and No. Default is No. Optional. |
MQMF_SEGMENTATION_ALLOWED (wsmq_MQMF_segmentAllowed) | Used to add the MQMF_SEGMENTATION_ALLOWED Message Flag option of the message descriptor (MQMD). Valid values are Yes and No. Default is MQMF_SEGMENTATION_INHIBITED. Optional. |
MQPMO_FAIL_IF_QUIESCING (wsmq_MQPMO_failifquiescing) | Used to add the QMPMO_FAIL_IF_QUIESCING Put Message Option. Valid values are Yes and No. Default is No. Optional. |
MQPMO_LOGICAL_ORDER (wsmq_MQPMO_logicalorder) | Used to add the MQPMO_LOGICAL_ORDER Put Message Option. Valid values are Yes and No. Default is Yes. Optional. |
MQPMO_NEW_CORREL_ID (wsmq_MQPMO_newCorId) | If yes, causes the queue manager to generate a new correlation identifier in the CorrelId field of the message descriptor (MQMD). Valid values are Yes and No. Default is No. Optional. |
MQPMO_NEW_MSG_ID (wsmq_MQPMO_newMsgId) | If yes, causes the queue manager to generate a new message identifier in the MsgId field of the message descriptor (MQMD). Valid values are Yes and No. Default is No. Optional. |
MQPMO_SET_ALL_CONTEXT (wsmq_MQPMO_setallcontext) | Used to add the MQPMO_SET_ALL_CONTEXT Put Message Option which indicates that the user will supply all the identity and origin fields. Valid values are Yes and No. Default is No. Optional. |
MQPMO_SET_IDENTITY_CONTEXT (wsmq_MQPMO_setidentitycontext) | Used to add the MQPMO_SET_IDENTITY_CONTEXT Put Message Option which indicates that the user will supply all the identity fields. Valid values are Yes and No. Default is No. Optional. |
MQPMO_SYNCPOINT (wsmq_MQPMO_syncpoint) | If yes, adds MQPMO_SYNCPOINT Put Message Option. If no, adds MQPMO_NO_SYNCPOINT Put Message Option. Valid values are Yes and No. Default is Yes. Optional. |
MQRO_COA (wsmq_MQRO_coa) | Sets the confirmation on arrival Report Option.
Optional. Valid values are:
|
MQRO_COD (wsmq_MQRO_cod) | Sets the confirmation on delivery Report Option.
Optional. Valid values are:
|
MQRO_DISCARD_MSG (wsmq_MQRO_discard) | If yes, adds the MQRO_DISCARD_MSG Report Option. Valid values are Yes and No. No assumes MQRO_DEAD_LETTER_Q. Optional. |
MQRO_EXCEPTION (wsmq_MQRO_exception) | Sets the exception Report Option. Optional. Valid
values are:
|
MQRO_EXPIRATION (wsmq_MQRO_expiration) | Sets the expiration Report Option. Optional. Valid
values are:
|
MQRO_NAN (wsmq_MQRO_nan) | If yes, adds the MQRO_NAN Report Option. Valid values are Yes and No. Default is No. Optional. |
MQRO_PAN (wsmq_MQRO_pan) | If yes, adds the MQRO_PAN Report Option. Valid values are Yes and No. Default is No. Optional. |
MQRO_PASS_CORREL_ID (wsmq_MQRO_passCorId) | If yes, adds the MQRO_PASS_CORREL_ID Report Option. Valid values are Yes and No. Default is No, which sets MQRO_COPY_MSG_ID_TO_CORREL_ID. Optional. |
MQRO_PASS_MSG_ID (wsmq_MQRO_passMsgId) | If yes, adds the MQRO_PASS_MSG_ID Report Option. Valid values are Yes and No. Default is No, which sets MQRO_NEW_MSG_ID. Optional. |
No Segment Splitting (wsmq_noSegSplit) | If messages need to be split (see wsmq_maxMsgSize), they will be sent as separate messages instead of segments. Valid values are Yes and No. Default is No. Optional. |
Queue Name (wsmq_qname) | The name of a previously opened queue used to PUT messages. Any value is valid. Required. |
wsmq_send_retryCount | Delay between two consecutive retries. |
wsmq_send_retrySleepInterval | Length between retries for the wsmq_send_retryCount parameter. Sleep interval is in milliseconds. |
wsmq_MQMD_encoding (V5.2.5 and higher) | Document encoding value. |
Parameters Passed From Business Process to Service
The following table contains the parameters passed from the business process to the WebSphereMQ Suite Put Message service:
Parameter | Description |
---|---|
All GPM parameters | See Setting Up the Service in the GPM. |
wsmq_sessionid(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 Put Message service to the business process.
Parameter | Description |
---|---|
sentMsgId | The message identifier that was sent with the message. This value was either assigned by the user or assigned by the queue manager. Because this value could contain embedded nulls, it is a hex representation of the string so that no characters are lost. |
sentCorId | The correlation identifier that was sent with the message. This value was either assigned by the user or assigned by the queue manager. Because this value could contain embedded nulls, it is a hex representation of the string so that no characters are lost. |
sentGrpId | The group identifier that was sent with the message. This value was either assigned by the user or assigned by the queue manager. Because this value could contain embedded nulls, it is a hex representation of the string so that no characters are lost. |
nextMsgSeqNum | If sending multiple messages as part of a logical group but MQPMO_LOGICAL_ORDER is not used and MQMF_MSG_IN_GROUP and/or MQMF_LAST_MSG_IN_GROUP is specified, the adapter will automatically take care of incrementing the message sequence number from its initial value but only if segmenting is required. In this scenario, the value of this variable should be used in the wsmq_MQMD_msgSeqNumber parameter to set the next initial message sequence number. |
nextMsgOffset | If sending multiple messages as part of a logical group but MQPMO_LOGICAL_ORDER is not used, the adapter will automatically take care of incrementing the message offset number from its initial value but only if segmenting is required. In this scenario, the value of this variable should be used in the wsmq_MQMD_offset parameter to set the next initial message offset value. |
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. |
The values of the parameters are added to the original document tag where necessary, as shown in this example that uses the sentMsgId parameter:
<ProcessData> <!-- before PUT -->
<PrimaryDocument SCIObjectID="1893rje:1231cc1ed55:-7c55"/>
</ProcessData>
<ProcessData> <!-- after PUT -->
<PrimaryDocument SCIObjectID="1893rje:1231cc1ed55:-7c55">
<sentMsgId>414D51204D515F47495321402102020204242ACF000009013
</sentMsgId>
</PrimaryDocument>
</ProcessData>
Business Process Example
The following example illustrates how the WebSphereMQ Suite Put Message 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>