Split Transactions on JSON Payload

Warning: The transaction split only works when the unmarshalling occurs through the org.json.JSONObject class and the get() method. Additionally, other message converters such as Jackson ObjectMapper and Gson are not supported.

You can access JSON payload for transaction identification purposes using the method where the Servlet unmarshalls the payload.

For example, the following JSON payload posts an order car creditcard http://acmeonline.com/store

order :{
type:creditcard,
id:123,
name:Car,
price:23
}}

The following code snippet shows the doPost

public void doPost(HttpServletRequest req, HttpServletResponse resp) {
//create JSONObject from servlet input stream
String orderType = jsonObject.get("type");
//read the item for the order
processOrder(orderType,item)
...
}

After the application unmarshalls the posted JSON payload to the JSON object, thetypekey is available to identify the type of the order. In this case, this key uniquely identifies the business transaction.

To use the JSON payload for transaction identification you must set the enable-json-bci-rules true

  1. On the Rule Configuration tab, checkSplit transactions using XML/JSON Payload or a Java method invocation.
  2. For the JSON object key, enter the name of the JSON object. For example, type .

The agent automatically intercepts the JSONObject. get("$JSON_Object_Key" doGet()