JTA module

This module aims to monitor commits/rollbacks and active transaction number.


commons-monitoring-jta should be added to your webapp. You need to register the jta gauges. To do it the easiest is to add commons-monitoring-web to your webapp and register the listener org.apache.commons.monitoring.web.discovery.GaugeDiscoveryListener:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

Note: you can register it manually using org.apache.commons.monitoring.gauges.Gauge$LoaderHelper or org.apache.commons.monitoring.repositories.Repository#addGauge.

Then you need to add on the beans which can be enrolled in transactions you want to monitor the annotation org.apache.commons.monitoring.jta.JTAMonitored (CDI beans) or the interceptor org.apache.commons.monitoring.jta.JTAInterceptor (for EJB for instance it can be done through configuration, see ejb-jar.xml).

Note: we are working to make it configurable - same note as for CDI module.