I have a JSON that looks something like the one pasted below. I am trying to extract each individual record and push it onto a queue. How would I extract each record in Mule? I've been trying to use the collection splitter and foreach loop, but I can't figure out how to get this to work.
{
"locations": {
"record": [
{
"id": 8817,
"loc": "NEW YORK CITY"
},
{
"id": 2873,
"loc": "UNITED STATES"
},
{
"id": 1501,
"loc": "NEW YORK STATE"
}
]
}
}
To do this:
record
listNow in Mule XML config:
<json:json-to-object-transformer returnClass="java.util.Map" />
<expression-transformer expression="#[payload.locations.record]" />
<collection-splitter />
<!-- TODO: dispatch to queue -->