3.6 Example 6: Business-to-Business Messaging Across a Firewall

This example demonstrates business-to-business messaging across a firewall as described in use cases Send Message to Queue – Application (section 2.5.3) and Receive a Message from a Queue – Application (section 2.5.6).

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 receiving application is authorized to receive messages from the queue.

  • The order entry application and the employee desktop Queue Manager are deployed on the same machine.

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

 Initial System State

The order queue is configured on the supplier server computer, with a name specified in the ordering system design, and the network address of the supplier server computer is provided to the order entry application.

The acknowledgments queue and the response queue are configured on the manufacturer server computer, with names specified in the ordering system design, and the network address of the manufacturer server computer is provided to the order processing application and the order entry application.

Final System State

The final state of MSMQ in this example is the same as the initial state.

Sequence of Events

The following figure shows the sequence of events for business-to-business messaging across a firewall.

Sequence diagram for Example 6

Figure 24: Sequence diagram for Example 6

  1. The order entry application creates a new unique transactional unit of work identifier XACTUOW ([MS-MQMQ] section 2.2.18.1.8) structure, encapsulates an order in an MSMQ message, and sends it to the employee desktop Queue Manager, as described in steps 1 through 2 of Example 1: Disconnected Data Entry (section 3.1).

  2. When network connectivity to the supplier server computer is available, the employee desktop Queue Manager transfers the order message to the supplier server Queue Manager using the Message Queuing (MSMQ): SOAP Reliable Messaging Protocol (SRMP) over the Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS) transport, as specified in [MC-MQSRM] section 3.1.1.1.2.1. The supplier server Queue Manager receives the message from the network, as specified in [MC-MQSRM] section 3.1.5.1.6, and stores it in its order queue.

  3. The order entry application creates a new unique transactional unit of work identifier XACTUOW structure and receives the order message from the supplier server Queue Manager, as described in steps 8 through 9 of Example 1: Disconnected Data Entry.

  4. When the order processing application receives the message from the order queue, the supplier server Queue Manager sends a positive acknowledgment to the Acknowledgments queue, including the message identifierof the original message, as specified in [MC-MQSRM] section 2.2.4.3.

  5. The order entry application receives the acknowledgment message from the manufacturer 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 1.

  6. The order processing application sends a response message to the supplier server 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 3, and commits the transaction by invoking the R_QMCommitTransaction ([MS-MQMP] section 3.1.4.15) method.

  7. When network connectivity to the supplier server computer is available, the supplier server Queue Manager  transfers the response message to the manufacturer server Queue Manager using the Message Queuing (MSMQ): SOAP Reliable Messaging Protocol (SRMP) over the Hypertext Transfer Protocol over Secure Sockets Layer (HTTPS) transport, as specified in [MC-MQSRM] section 3.1.1.1.2.1. The manufacturer server Queue Manager receives the message from the network and stores it in the response queue, as specified in [[MC-MQSRM] section 3.1.5.1.6.

  8. The order entry application receives the response message from the manufacturer server Queue Manager by invoking the rpc_ACReceiveMessageEx method, providing a ptb input parameter initialized with the XACTUOW structure created at step 1, and commits the transaction by invoking the R_QMCommitTransaction method.