8.2 Configure Library Properties

Provide configuration information for the MicroTx client library properties. You must perform this step for all participant and initiator applications.

For JAX-RS and Node.js applications, open the tmm.properties file in any code editor, and then enter values for the following parameters to configure the MicroTx library. For Spring REST applications, use the application.yaml file.

The name of the properties differ for JAX-RS and Spring REST applications, but the functionality remains the same.

  • oracle.tmm.TcsUrl for JAX-RS apps or spring.microtx.coordinator-url for Spring REST apps: Enter the URL to access the MicroTx application. See Access MicroTx. You must enter this value for the transaction initiator application. You don't have to specify this value for the transaction participant applications.

  • oracle.tmm.PropagateTraceHeaders for JAX-RS apps or spring.microtx.propagation-active for Spring REST apps: Set this to true when you want to trace the transaction from end-to-end. This propagates the trace headers for all incoming and outgoing requests. For Helidon-based microservices, set this property to false to avoid propagating the trace headers twice as Helidon framework propagates trace headers by default. You can set this property to true if propagation of trace headers is disabled in Helidon configuration and you want to enable distributed tracing with MicroTx. For other microservices, set this property to true.

The following example provides sample values for the MicroTx client library properties for a JAX-RS application.

oracle.tmm.TcsUrl = http://tmm-app:9000/api/v1
oracle.tmm.PropagateTraceHeaders = true

The following example provides sample values for the MicroTx client library properties for a Spring REST application.

spring:
  microtx:
    coordinator-url: http://tmm-app:9000/api/v1
    propagation-active: true

You can use the HTTP protocol if your application and MicroTx are in the same Kubernetes cluster, otherwise use the HTTPS protocol.

You can also provide these configuration values as environment variables. Note that if you specify values in both the properties file as well as the environment variables, then the values set in the environment variables override the values in the properties file.

The following example provides sample values to configure the environment variables for JAX-RS apps.

export ORACLE_TMM_TCS_URL = http://tmm-app:9000/api/v1
export ORACLE_TMM_PROPAGATE_TRACE_HEADERS = true

The following example provides sample values to configure the environment variables for Spring REST apps.

export SPRING_MICROTX_COORDINATOR_URL = http://tmm-app:9000/api/v1
export SPRING_MICROTX_PROPAGATION_ACTIVE = true

Note that the environment variables names are case-sensitive.