Split by POJO Method Call
Using a Java method to name a transaction is useful when:
- You might not have a clear URI pattern, or
- You are using an XML/JSON framework not otherwise supported
For example, consider the processOrder() doPost() http://acmeonline.com/store
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
//process the data from the sevlet request and get the orderType and the items
processOrder(orderType,item)
...
}
public void processOrder(String orderType,String item) {
//process order
}
You want to derive transaction naming from the first parameter to the processOrder() orderType
- On the Rule Configuration tab for the custom match rule, enable the Split Transactions using the XML/JSON payload or Java method invocation.
- Select POJO Method Call as the splitting mechanism.
- For the method, choose the processOrder, and specify the parameter to use by numeric position in the parameter (0 index). The following screenshot displays the configuration of a custom match rule which will name all the qualifying requests into a
Store.order.creditcard
transaction: