Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 13 Using the TIBCO Service Gateway for WMQ : Overview

Overview
Service Gateway for WMQ is a Message Oriented Middleware (MOM) application containing several shared tools.You use it to create, send, receive, and process messages in a network of WebSphere MQ-enabled TIBCO Object Service Broker and non-TIBCO Object Service Broker applications. This message processing can take place across supported platforms.
For details about installing Service Gateway for WMQ, see TIBCO Object Service Broker for z/OS Installing and Operating.
Usage Notes
System Map Table
The interface between the rules and WebSphere MQ is controlled by the internal @MOMMAP map table and the corresponding MOM-specific table, for example, @MQSMAP. This is set up by the @MOMINIT shareable tool.
Required Local Variable
Prior to your first @MOM... call, you must define a local variable called @MOMMAP_ADDRESS, to be available to all subsequent @MOM... calls.
WebSphere MQ Environment
Only one MOM environment can be active in any one session at a time. The environment is owned by the transaction issuing the @MOMINIT call. The environment can be shared only with transactions executed by that transaction. You do this by passing @MOMMAP_ADDRESS.
Possible TASKEXECNUM Increase
TIBCO Service Gateway for WMQ is TCB-specific. Therefore @MOMINIT sets TCB affinity for the transaction. This means an interpreter TCB is held for the duration of the transaction. In a multi-user Execution Environment, this can require you to increase the TASKEXECNUM Execution Environment parameter.
See Also
TIBCO Object Service Broker Parameters for details on the TASKEXECNUM Execution Environment parameter.
Error Handling
The return code and reason code from the MOM software are stored in the map table @MQSMAP which is a shareable tool. You can check these stored codes in your rules. Refer to @MQSMAP in TIBCO Object Service Broker Shareable Tools for more information about this tool.
Example Rule
The following rule moves all the messages from one queue to another. In this rule, @MOMBUFFER is a MAP table set up by the writer of the rule to describe the data being written.

 
MOMPASSER;
_ LOCAL @MOMMAP_ADDRESS, CONNECTION, QUEUE1, QUEUE2;
_ -------------------------------------------------------------------
_ ------------------------------------------------------------+------
_ CALL @MOMINIT(1000, 'MQSERIES'); ¦ 1
_ CONNECTION = @MOMCONNECT('CSQ1'); ¦ 2
_ CALL @MOMVALIDRC; ¦ 3
_ CALL @MOMSETOPT('MQOO_INPUT_SHARED'); ¦ 4
_ QUEUE2 = @MOMOPEN(CONNECTION, 'RON2'); ¦ 5
_ CALL @MOMVALIDRC; ¦ 6
_ CALL @MOMSETOPT('MQOO_OUTPUT'); ¦ 7
_ QUEUE1 = @MOMOPEN(CONNECTION, 'RON1'); ¦ 8
_ CALL @MOMVALIDRC; ¦ 9
_ CALL @MOMSETOPT('MQPMO_NONE'); ¦ A
_ @MQSMAP.GO_WAITINTERVAL = 10000000; ¦ B
_ @MQSMAP.GO_OPTIONS = @MOMOPTION('MQGMO_WAIT'); ¦ C
_ @MQSMAP.GO_MATCHOPTIONS = @MOMOPTION('MQGMO_NONE'); ¦ D
_ UNTIL MOM_SHUTDOWN : ¦ E
_ CALL @MOMGET(CONNECTION, QUEUE2, '@MOMBUFFER'); ¦
_ CALL @MOMVALIDRC; ¦
_ CALL @MOMPUT(CONNECTION, QUEUE1, '@MOMBUFFER', 80); ¦
_ CALL @MOMVALIDRC; ¦
_ CALL @MOMCOMMIT(CONNECTION); ¦
_ CALL @MOMVALIDRC; ¦
_ END; ¦
_ CALL MSGLOG('SHUTDOWN RECEIVED.'); ¦ F
_ QUEUE1 = @MOMCLOSE(CONNECTION, QUEUE1); ¦ G
_ CALL @MOMVALIDRC; ¦ H
_ QUEUE2 = @MOMCLOSE(CONNECTION, QUEUE2); ¦ I
_ CALL @MOMVALIDRC; ¦ J
_ CONNECTION = @MOMDISCONN(CONNECTION); ¦ K
_ CALL @MOMVALIDRC; ¦ L
_ CALL ENDMSG('NORMAL SHUTDOWN DETECTED.'); ¦ M
_ -------------------------------------------------------------------
_ ON MOM_INV_MOMMSG :
_ QUEUE1 = @MOMCLOSE(CONNECTION, QUEUE1);
_ QUEUE2 = @MOMCLOSE(CONNECTION, QUEUE2);
_ CONNECTION = @MOMDISCONN(CONNECTION);
_ CALL ENDMSG('INVALID MOM MSG DETECTED.');

 
See Also
TIBCO Object Service Broker Shareable Tools about the MOM shareable tools.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved