6.6 Configure Library Properties

Provide configuration information for the MicroTx library properties for JAX-RS, Spring REST, and Node.js applications. Specify the library property values for both 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.TcsConnPoolSize: Enter the number of connections to the MicroTx library to MicroTx. The default and minimum number of connections is 10. The maximum value is 20. You can change this value depending on the number of queries that your services run. Specify this value for both initiator and participant applications.

  • oracle.tmm.CallbackUrl: Enter the URL of your participant service. MicroTx uses the URL that you provide to connect to the participant service. Provide this value in the following format:

    https://externalHostnameOfApp:externalPortOfApp/
    Where,
    • externalHostnameOfApp: The external host name of your initiator or participant service. For example, bookTicket-app.
    • externalPortOfApp: The port number over which you can access your participant service remotely. For example, 8081.
    You must specify this value for the transaction participant applications. You don't have to specify this value for the transaction initiator application.
  • oracle.tmm.TransactionTimeout: Specify the maximum amount of time, in milliseconds, for which the transaction remains active. If a transaction is not committed or rolled back within the specified time period, the transaction is rolled back. The default value and minimum value is 60000. Specify this value for both initiator and 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.

  • oracle.tmm.xa.Rmid: Specify a unique string value for each resource manager that you use in the XA transaction. This value is not related to any properties of the data store. The unique value that you provide as RMID is used by MicroTx to identify the resource manager. If more than one participant uses the same resource manager, then specify the same resource manager ID for the participants that share a resource manager. It is mandatory to provide this value.
  • oracle.tmm.xa.XaSupport: Set this to true when you use XA-compliant resources. Set this to false only for the single transaction participant service that uses a non-XA resource. The default value is true. When oracle.tmm.xa.XaSupport is set to true, the values set for oracle.tmm.xa.LLRSupport and oracle.tmm.xa.LRCSupport are ignored.
  • oracle.tmm.xa.LLRSupport: Set this to true to enable the Logging Last Resource (LLR) optimization. Set this value only for the transaction participant service that uses a non-XA resource as a resource manager. The default value is false. When oracle.tmm.xa.LLRSupport is set to true, the value set for oracle.tmm.xa.LRCSupport is ignored.

    Only when you set this property value to true, you can also specify a value for the oracle.tmm.LlrDeleteCommitRecordInterval property. Specify the maximum amount of time, in milliseconds, for which the committed records are retained. The default value is 7,200,000 ms or 2 hours. Before performing a local commit, the transaction coordinator creates a commit record in the LLR branch. The commit records are deleted after the time period specified in the oracle.tmm.LlrDeleteCommitRecordInterval property. Specify this value only for the service that uses a non-XA resource as a resource manager.

  • oracle.tmm.xa.LRCSupport: Set this to true to enable the Last Resource Commit (LRC) optimization. Set this value only for the transaction participant service that uses a non-XA resource as a resource manager. The default value is false.
  • oracle.tmm.WeblogicTxnSupport: Set this to true only for the JAX-RS applications, deployed on WebLogic Server, that participate in XA transaction. When you set this property to true, MicroTx ignores the values for oracle.tmm.xa.XaSupport, oracle.tmm.xa.LLRSupport, and oracle.tmm.xa.LRCSupport. The name of the corresponding environment variable is ORACLE_TMM_WEBLOGIC_TXN_SUPPORT.
  • oracle.tmm.promotable: Set this to true to enable the transaction promotion feature. Specify this value only for a transaction initiator service that also participates in the transaction.

    The default value is false. If you set the value of oracle.tmm.promotable as false, every transaction starts as a global transaction by default and it is associated with a GTRID. A local transaction is not initiated. See About Global and Local Transactions.

  • oracle.tmm.xa.isRAC or oracle.tmm.xa.RACSupport: Set this to true only for the transaction participant service that uses an Oracle Real Application Clusters (RAC) database as a resource manager. The default value is false. Specify this property value for For Node.js applications, specify a value for the oracle.tmm.xa.RACSupport property. For JAX-RS applications, specify a value for the oracle.tmm.xa.isRAC property.
For example,
oracle.tmm.TcsUrl = http://tmm-app:9000/api/v1
oracle.tmm.TcsConnPoolSize = 15
oracle.tmm.CallbackUrl = https://bookTicket-app:8081
oracle.tmm.PropagateTraceHeaders = true
oracle.tmm.TransactionTimeout = 60000
oracle.tmm.xa.XaSupport = true
oracle.tmm.xa.LLRSupport = false
oracle.tmm.xa.LRCSupport = false
oracle.tmm.xa.Rmid = ORCL1
oracle.tmm.promotable = true
oracle.tmm.xa.isRAC = false

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.

export ORACLE_TMM_TCS_URL= http://tmm-app:9000/api/v1
export ORACLE_TMM_CALLBACK_URL = http://bookTicket-app:8081
export ORACLE_TMM_PROPAGATE_TRACE_HEADERS = true
export ORACLE_TMM_TCS_CONN_POOL_SIZE = 15
export ORACLE_TMM_TRANSACTION_TIMEOUT = 60000
export ORACLE_TMM_XA_XASUPPORT = true
export ORACLE_TMM_XA_LLRSUPPORT = false
export ORACLE_TMM_XA_LRC_SUPPORT = false
export ORACLE_TMM_XA_RMID = ORCL1
export ORACLE_TMM_XA_PROMOTABLE = true
export ORACLE_TMM_XA_ISRAC= false

Note that the environment variables names are case-sensitive.