7.2.4 Develop Micronaut Apps with Saga

You can integrate the MicroTx library files with Micronaut applications that use the Saga transaction protocol.

To integrate the MicroTx library files with your Micronaut applications:

  1. Include the MicroTx Java library file as a maven dependency in the Micronaut application's pom.xml file. The following sample code is for the 24.2 release. Provide the correct version, based on the release version that you want to use.
    <dependency>
         <groupId>com.oracle.microtx.lra</groupId>
         <artifactId>microtx-lra-micronaut</artifactId>
         <version>24.2</version>
    </dependency>
  2. Specify values for the MicroTx library properties in the application.properties file of your application. This enables the custom library to establish communication with the MicroTx Saga coordinator, participate in Saga transactions, and propagate the relevant headers for the coordinated transactions. See Configure MicroTx Library Properties for Java Apps.
  3. Import the com.oracle.microtx.lra.annotation.* package.
    import com.oracle.microtx.lra.annotation.*