9.3 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.
spring.microtx.coordinator-url
for Spring REST apps andoracle.tmm.TcsUrl
for other 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.spring.microtx.propagation-active
for Spring REST apps andoracle.tmm.PropagateTraceHeaders
for other apps: Set this totrue
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 tofalse
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 totrue
.
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
The following example provides sample values for the MicroTx client library properties for others apps, such as JAX-RS, Python, or Node.js applications.
oracle.tmm.TcsUrl = http://tmm-app:9000/api/v1
oracle.tmm.PropagateTraceHeaders = 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 Spring REST apps.
export SPRING_MICROTX_COORDINATOR_URL = http://tmm-app:9000/api/v1
export SPRING_MICROTX_PROPAGATION_ACTIVE = true
The following example provides sample values to configure the environment variables for others apps, such as JAX-RS, Python, or Node.js applications.
export ORACLE_TMM_TCS_URL = http://tmm-app:9000/api/v1
export ORACLE_TMM_PROPAGATE_TRACE_HEADERS = true
Note that the environment variables names are case-sensitive.
Parent topic: Develop Applications with TCC