Page created: 9 Feb 2021
|
Page updated: 10 Aug 2021
You can chain processors together to combine data preprocessing steps.
For example, you can extract data using JSONPath and then apply a SpEL processor to the
extracted data. Assume you have a service that resolves to the following JSON
response.
{
"name": "Joe Bloggs",
"city": "London",
"country": "UK"
}
You have a requirement to extract the country and transform the value to United
Kingdom
whenever the current value is UK
. You would add a
JSONPath processor to select the country followed by a SpEL expression to transform the
selection, as shown in the following figure.
Reusing chained processors
You can make a chained processor reusable by creating it as a named value processor. Then you can construct more complex processor chains made up of those named value processors.