There are two socket connections, shareable persistent socket and dedicated persistent socket, that can be used to retrieve asynchronous output. The way to retrieve asynchronous output messages is different depending on the socket connection used. The interactionVerb properties that can retrieve asynchronous output are: SYNC_RECEIVE_ASYNCOUTPUT, SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT, and SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT.
All three interactionVerb properties require commit mode 0 and they can be used on both shareable persistent socket connections and dedicated persistent socket connections. The way the interactionVerb properties are invoked on shareable or dedicated persistent socket connections is different.
Note: There is no function difference between SYNC_RECEIVE_ASYNCOUTPUT or SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT. However, it is recommended that you use SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT with the IMS resource adapter 9.1.0.1 and future releases.
The difference between SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT and SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT is whether IMS Connect waits or not wait for IMS OTMA to return a message. For SYNC_RECEIVE_ASYNCOUTPUT or SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT interactions, if there is no asynchronous output in the IMS OTMA Asynchronous Hold Queue when the retrieve request is made, IMS Connect returns a timeout notification almost immediately depending on the execution timeout value the client application specified. (A small timeout value is recommended.) For a SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT interaction, if there is no asynchronous output in the IMS OTMA Asynchronous Hold Queue when the retrieve request is made, IMS Connect waits for OTMA to return a message and waits the length of time specified in the executionTimeout property of the interaction.
Retrieving asynchronous output on dedicated persistent socket connections
To retrieve the queued output message on a dedicated persistent socket, the client application must execute a commit mode 0 interaction with the interactionVerb property of IMSInteractionSpec set to SYNC_RECEIVE_ASYNCOUTPUT, SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT, or SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT.
In addition to executing a commit mode 0 interaction on a dedicated persistent socket connection with the appropriate interactionVerb property of IMSInteractionSpec, the client application must also provide a value for the clientID property of IMSConnectionSpec. The clientID is required because it represents the associated TPIPE to which the asynchronous output is queued.
To retrieve output messages from a commit mode 0 interaction on a dedicated persistent socket, the value of clientID is the value specified for the original commit mode 0 interaction. To retrieve output messages on an alternate PCB, the value of clientID is the name of the alternate PCB. To retrieve output messages which were rerouted to a defined destination, the value of the clientID is the previous specified value of the reRouteName property.
Retrieving asynchronous output on shareable persistent socket connection
To retrieve undelivered asynchronous output messages on a shareable socket connection, the client application must execute a commit mode 0 interaction on a shareable persistent socket with the interactionVerb property of IMSInteractionSpec set to SYNC_RECEIVE_ASYNCOUTPUT, SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_NOWAIT, or SYNC_RECEIVE_ASYNCOUTPUT_SINGLE_WAIT.
To retrieve asynchronous output on shareable persistent sockets, the interactionVerb property must be invoked within the same client application. The reason that the interactionVerb must be invoked within the same client application is because the IMS resource adapter automatically generates a client ID for shareable socket connections. This generated clientID represents and identifies the socket connection as well as the associated OTMA TPIPE to which the asynchronous output is queued. A new client ID is generated when a new connection is established. The messages that are queued on the TPIPE are associated with the generated clientID. To retrieve queued asynchronous output from an interaction that was executed by a client application, the interactionVerb must be invoked within the same client application so that the same shareable socket connection with the correct associated generated clientID is used.
Any interaction that is sent on a shareable persistent socket, a value for the clientID property of IMSConnectionSpec must not be specified. A user specified clientID is not allowed on a shareable socket connection and only a generated clientID is used to retrieve asynchronous output on a shareable persistent socket.