I have two different payloads here in format:
{"addressLine1":"POSBUS 007","addressLine3":"-1","postalCode":"1200"}
{"email":"xxxx@xxx.net"}.
If I use the scatter gather i get the following payload:
[{"addressLine1":"POSBUS 007","addressLine3":"-1","postalCode":"1200"}, {"email":"xxxx@xxx.net"}]
But what I want to do is merge those two payloads into one payload like for instance:
{"addressLine1":"POSBUS 007","addressLine3":"-1","postalCode":"1200", "email":"xxxx@xxx.net"}
There are several good ways to solve this problem. Here's one using groovy:
<json:json-to-object-transformer returnClass="java.util.HashMap" />
to transform the JSON payload to a Map.<set-payload value="#[groovy:payload.inject([:]) {result, part -> result.putAll(part); result}]" />