2.5.4 Send Message in Transaction - Application

 Context of Use: This use case extends the Send Message to Queue - Application (section 2.5.3) use case by adding transactional semantics to the message send operation. In this use case, the application and the queue manager interact with a Transaction Coordinator to send one or more messages in the context of a transaction. The messages are visible only after a successful outcome of the transaction. A failed outcome of the transaction undoes the entire message send operation.

 Goal: This use case places one or more messages in a queue in the context of an atomic transaction.

 Actors

Application:  See section 2.5.

Application Users:  See section 2.5.

Transaction Coordinator: See section 2.5.

 Stakeholders

Developers: See section 2.5.

Testers: See section 2.5.

Application Users: See section 2.5.

 Preconditions

This use case has the following precondition, in addition to those described in the Send Message to Queue - Application extended use case:

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

 Main Success Scenario

 Trigger: The direct actor triggers this use case based on the actions of the primary actor. It is also triggered by the Exchange Message - Application (section 2.5.8) use case.

The steps involved in this use case are as follows:

  1. The application creates a transaction and follows steps 1 through 4 of Send Message to Queue - Application to send each message to the queue manager in the context of the transaction.

  2. The queue manager enlists in the transaction if it has not enlisted in the transaction yet and does not make the messages visible outside the context of the transaction.

  3. The queue manager returns a response back to the application.

  4. The application commits or aborts the transaction, and the Transaction Coordinator communicates the outcome of the transaction to the resource manager facet of the queue manager. Upon a successful outcome, the queue manager makes the messages visible, and this use case continues to the next step. Conversely, on a failed outcome of the transaction, the queue manager undoes the message send operations, and this use case completes.

  5. 5. For each message that is sent, follow step 6 of Send Message to Queue - Application.

 Postconditions

  • If the transaction succeeds, the messages are placed in the destination queue as with the post condition in Send Message to Queue - Application.

  • If the transaction fails, the messages do not appear in the destination queue.

Extensions

None.