3.1 Example 1: Disconnected Data Entry

This example demonstrates disconnected data entry as described in the Send Message in Transaction - Application (section 2.5.4) and Receive Message in Transaction – Application (section 2.5.7) use cases.

Prerequisites

  • See the common prerequisites defined in section 3 .

  • The queue exists.

  • The application is authorized to send messages to the queue.

  • If a Directory Service is not being used, the application is configured with the address of the queue prior to the send operation.

  • The Transaction Coordinator is accessible to the application and the queue manager in order to coordinate the transaction execution.

  • The receiving application is authorized to receive messages from the queue.

  • The order entry application and the salesperson laptop Queue Manager are deployed on the same machine.

  • The order processing application and the central office server Queue Manager are deployed on the same machine.

Initial System State

One queue, the order queue, is configured on the central office server computer, and the network address of the central office server computer is provided to the Order Entry application.

Final System State

The final state of the Message Queuing System in this example is the same as the initial state.

Sequence of Events

The following figure shows the sequence of events for this example.

Example of disconnected data entry

Figure 19: Example of disconnected data entry

  1. The order entry application creates a new unique transactional unit of work identifier XACTUOW ([MS-MQMQ] section 2.2.18.1.8) structure and invokes the ([MS-MQMP] section 3.1.4.14) method to create an internal transaction handle for the XACTUOW structure.

  2. The order entry application sends message 1 to the salesperson laptop Queue Manager by invoking the rpc_ACSendMessageEx ([MS-MQMP] section 3.1.5.2) method of the qmcomm2 interface, providing a ptb input parameter initialized with the XACTUOW structure created at step 1.

  3. The order entry application commits the transaction by invoking the R_QMCommitTransaction ([MS-MQMP] section 3.1.4.15) method, specifying the internal transaction handle obtained at step 1.

  4. The salesperson laptop Queue Manager stores message 1 in its outgoing queue.

  5. The salesperson laptop Queue Manager sends an EstablishConnection Packet [MS-MQQB] section 2.2.3) and a ConnectionParameters Packet ([MS-MQQB] section 2.2.2) to initialize a session with the central office server Queue Manager and sends message 1 stored in the outgoing queue to the central office server Queue Manager.

  6. The central office server Queue Manager stores message 1 in its order queue.

  7. The central office server Queue Manager sends a SessionAck Packet ([MS-MQQB] section 2.2.6) and an OrderAck Packet ([MS-MQQB] section 2.2.4) to the salesperson laptop Queue Manager to acknowledge that it has received message 1, as specified in [MS-MQQB] section 3.1.1.7.3.

  8. The order processing application creates a new unique transactional unit of work identifier XACTUOW structure and invokes the R_QMEnlistInternalTransaction method to create an internal transaction handle for the XACTUOW structure.

  9. The order processing application receives message 1 from the central office server Queue Manager by invoking the rpc_ACReceiveMessageEx ([MS-MQMP] section 3.1.5.3) method of the qmcomm2 interface, providing a ptb input parameter initialized with the XACTUOW structure created at step 8.

  10. The order processing application commits the transaction by invoking the R_QMCommitTransaction method, specifying the internal transaction handle obtained at step 8.

  11. The central office server Queue Manager deletes message 1 from its queue manager.

  12. The central office server Queue Manager sends a FinalAck Packet ([MS-MQQB] section 2.2.5) to the salesperson laptop Queue Manager as an end-to-end acknowledgment.

  13. The order entry application creates a new unique transactional unit of work identifier XACTUOW structure and invokes the R_QMEnlistInternalTransaction method to create an internal transaction handle for the XACTUOW structure.

  14. The order entry application sends message 2 to the salesperson laptop Queue Manager by invoking the rpc_ACSendMessageEx method, providing a ptb input parameter initialized with the XACTUOW structure created at step 13.

  15. The order entry application commits the transaction by invoking the R_QMCommitTransaction method, specifying the internal transaction handle obtained at step 14.

  16. The salesperson laptop Queue Manager stores message 2 in its outgoing queue.

  17. The salesperson laptop Queue Manager attempts to initialize a session with the central office server Queue Manager by sending an EstablishConnection Packet and a ConnectionParameters Packet  and attempts to send message 2 stored in the outgoing queue to the central office server Queue Manager.

  18. The transfer of message 2 fails due to network related issues, and no protocol acknowledgment is received by the salesperson laptop Queue Manager.

  19. The salesperson laptop Queue Manager again attempts to initialize a session with the central office server Queue Manager by sending an EstablishConnection Packet and a ConnectionParameters Packet  and attempts to send message 2  stored in the outgoing queue to the central office server Queue Manager.

  20. The transfer of message 2 fails again due to network-related issues, and no protocol acknowledgment is received by the salesperson laptop Queue Manager.

  21. The salesperson laptop Queue Manager deletes message 2 from its queue manager and places it in the dead-letter queue.

  22. The order entry application queries the dead-letter queue of the salesperson laptop Queue Manager and receives message 2 from the salesperson laptop Queue Manager, as described in steps 8 through 10.