7 Develop Applications with Saga

The Transaction Manager for Microservices (MicroTx) library for Spring REST, Micronaut, and Node.js apps provides the functionality to initiate a new Saga transaction or to participate in an existing Saga transaction.

Before you begin, ensure that you have installed MicroTx and access it.

Develop, test, and deploy your microservices independently. To use MicroTx to manage the transactions in your application, you need to make a few changes to your existing application code to integrate the functionality provided by the MicroTx libraries.

Use the following workflow as a guide to develop your applications to use MicroTx to manage Saga transactions.

Task Description More Information
Provide configuration information for the MicroTx library properties. Perform this step for all the transaction participant and transaction initiator Node.js applications, so that your Node.js applications can access the library. Configure Library Properties for Node.js Apps
Integrate MicroTx library with your application code. Select a suitable procedure to integrate the library based on the following factors:
  • the development framework for your application
  • whether an application initiates the transaction or participates in the transaction
The library is available for Java and Node.js apps. Perform one of the following tasks:
Enable session affinity When you use internal memory as data store and deploy the transaction coordinator on more than one replica, then you must enable session affinity for Saga and XA transactions. You don't need to enable session affinity for TCC transactions. Enable Session Affinity
Deploy your application After using the library files in your application, install the application. Deploy Your Application