OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

3.6.5 Synchronous message processing

Use synchronous message processing to confirm the completion of the sending of messages during MHP processing or to synchronize UAP message exchange processing between systems. As for synchronous message exchange processing, send or receive processing is requested, the processing is completed, then the function called by the UAP returns.

Organization of this subsection
(1) Types of synchronous message
(2) Time monitoring of synchronous message processing
(3) Synchronous message processing and rollback

(1) Types of synchronous message

The following functions are available for synchronous message exchange processing:

Synchronous message send processing

Use the function dc_mcf_sendsync() [CBLDCMCF('SENDSYNC')] to execute synchronous message send processing. When the UAP calls the function dc_mcf_sendsync(), the MCF writes a message to the output buffer (the output queue in memory), then sends the message to the own system. After the MCF confirms that the sending of the message to the own system is completed, the function dc_mcf_sendsync returns.

Synchronous message receive processing

When receiving a message from the own system, the MCF stores the message in the input buffer. The MHP calls the function dc_mcf_recvsync() [CBLDCMCF('RECVSYNC')] to receive the message.

If a message has been received from the own system, the message is passed to the function dc_mcf_recvsync(). If a message has not been received from the own system, the function dc_mcf_recvsync() continues waiting until a message is received. As soon as a message is received from the own system, the message is passed to the function dc_mcf_recvsync().

Synchronous message exchange processing

Send processing and receive processing for synchronous messages can be done by one function. The MHP calls the function dc_mcf_sendrecv() [CBLDCMCF('SENDRECV')] to request the MCF to send a message. The MCF writes a message to the output queue, then sends the message to the own system. Even after send processing is completed, the function dc_mcf_sendrecv() does not return and proceeds to receive processing. The function dc_mcf_sendrecv() returns when receive processing is completed.

(2) Time monitoring of synchronous message processing

Monitoring time can be set to prevent the UAP from waiting for a response infinitely during synchronous message processing. Set the monitoring time for the argument watchtime. If 0 is specified, the synchronous exchange monitoring time specified in the UAP common definition of the MCF manager definitions is assumed to be specified. If 0 is defined as the monitoring time in the UAP common definition, the UAP waits for a response infinitely.

You can select whether to include the synchronous message processing time in the expiry time in a transaction branch. Specify this value using trn_expiration_time_suspend of the user service definition, user service default definition, and transaction service definition. You cannot include synchronous message processing time in a non-transactional MHP expiry time. For details on the value to be assigned to trn_expiration_time_suspend and transaction time monitoring, see the manual OpenTP1 System Definition.

(3) Synchronous message processing and rollback

If the MHP is rolled back, the synchronous message is not discarded. However, the message is discarded if multiple segments were sent by the function dc_mcf_sendsync() or dc_mcf_sendrecv and the function return() was called without the designation of the last segment (EMI).

The figure below shows synchronous message processing.

Figure 3-10 Synchronous message processing

[Figure]