Chapter 4. Configuring the Narayana transaction manager
Chapter 4. Configuring the Narayana transaction manager
In Fuse, the built-in, global transaction manager is JBoss Narayana Transaction Manager, which is the same transaction manager that is used by Enterprise Application Platform (EAP) 7.
In the OSGi runtime, as in Fuse for Karaf, the additional integration layer is provided by the PAX TRANSX project.
The following topics discuss Narayana configuration:
The 7.13.0.fuse-7_13_0-00012-redhat-00001 distribution makes these interfaces available from the start.
The pax-transx-tm-narayana feature contains an overridden bundle that embeds Narayana:
karaf@root()> feature:info pax-transx-tm-narayana
Feature pax-transx-tm-narayana 0.3.0
Feature has no configuration
Feature has no configuration files
Feature depends on:
pax-transx-tm-api 0.0.0
Feature contains followed bundles:
mvn:org.jboss.fuse.modules/fuse-pax-transx-tm-narayana/7.0.0.fuse-000191-redhat-1 (overriden from mvn:org.ops4j.pax.transx/pax-transx-tm-narayana/0.3.0)
Feature has no conditionals.
karaf@root()> feature:info pax-transx-tm-narayana
Feature pax-transx-tm-narayana 0.3.0
Feature has no configuration
Feature has no configuration files
Feature depends on:
pax-transx-tm-api 0.0.0
Feature contains followed bundles:
mvn:org.jboss.fuse.modules/fuse-pax-transx-tm-narayana/7.0.0.fuse-000191-redhat-1 (overriden from mvn:org.ops4j.pax.transx/pax-transx-tm-narayana/0.3.0)
Feature has no conditionals.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
The services provided by the fuse-pax-transx-tm-narayana bundle are:
The Narayana transaction manager is the JBoss/Red Hat product that is used in EAP. Narayana is a transactions toolkit that provides support for applications that are developed using a broad range of standards-based transaction protocols:
The pax-transx-tm-narayana bundle includes the jbossts-properties.xml file, which provides the default configuration of different aspects of the transaction manager. All of these properties may be overriden in the $FUSE_HOME/etc/org.ops4j.pax.transx.tm.narayana.cfg file directly or by using the Configuration Admin API.
The basic configuration of Narayana is done through various EnvironmentBean objects. Every such bean may be configured by using properties with different prefixes. The following table provides a summary of configuration objects and prefixes used:
The prefix can simplify the configuration. However, you should typically use either of the following formats:
NameEnvironmentBean.propertyName (the preferred format), or
fully-qualified-class-name.field-name
For example, consider the com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean.commitOnePhase field. It may be configured by using the com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean.commitOnePhase property or it can be configured by using the simpler (preferred) form CoordinatorEnvironmentBean.commitOnePhase. Full details of how to set properties and which beans can be configured can be found in the Narayana Product Documentation.
Some beans, such as the ObjectStoreEnvironmentBean, may be configured multiple times with each named instance providing configuration for a different purposes. In this case, the name of the instance is used between the prefix (any of the above) and field-name. For example, a type of object store for an ObjectStoreEnvironmentBean instance that is named communicationStore may be configured by using properties that are named:
The most important configuration is the type and location of object log storage. There are typically three implementations of the com.arjuna.ats.arjuna.objectstore.ObjectStoreAPI interface:
The default configuration of these three stores is:
default store
communication store
state store
# default store
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.objectStoreType = com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.objectStoreDir = ${karaf.data}/narayana
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.localOSRoot = defaultStore
# communication store
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.communicationStore.objectStoreType = com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.communicationStore.objectStoreDir = ${karaf.data}/narayana
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.communicationStore.localOSRoot = communicationStore
# state store
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.stateStore.objectStoreType = com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.stateStore.objectStoreDir = ${karaf.data}/narayana
com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.stateStore.localOSRoot = stateStore
Copy to ClipboardCopied!Toggle word wrapToggle overflow
ShadowNoFileLockStore is configured with the base directory (objectStoreDir) and the particular store’s directory (localOSRoot).
The many configuration options are contained in the Narayana documentation guide. However, the Narayana documentation states that the canonical reference for configuration options is the Javadoc for the various EnvironmentBean classes.
We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.
About Red Hat
We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.