Exclude Selected Activities from Transactions
Asynchronous frameworks use lower-level asynchronous mechanisms that are not related to the processing of user transactions (for example, a thread pool might grow and shrink automatically, depending on the load or a framework might initialize its thread pool upon the first use). You must ignore threads used in these contexts since their lifecycle is not bound to any individual application transaction.
To facilitate the exclusion of such asynchronous components (usually Threads and other
Runnables), the Executor mode offers a mechanism called
app-agent-config.xml capture suppression. The suppression is tied
to a specific method by a suppression rule in the async-config section of
app-agent-config.xml. Consider the following example of such a rule
provided by default:
<job>
<match-class type="matches-class"><name filter-type="EQUALS" filter-value="java.util.concurrent.ThreadPoolExecutor"/></match-class>
<match-method><name filter-type="EQUALS" filter-value="addWorker"/></match-method>
<action type="suppression"/>
</job> The addWorker java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor class
is a private method invoked by ThreadPoolExecutor whenever a new worker
thread is to be created, started and added to the pool. Since such threads are not
directly associated with any individual transaction at the point of creation, a
suppression rule is used in order that any asynchronous task hands offs occurring within
this method will not get associated with the transaction. Any asynchronous tasks
subsequently executed by these threads will be associated with the transaction that
created the task.