I tried to extract json array data using message enricher. But in output I got some object data.How can I fetch properly?
Following is my flow
<flow name="readfileFlow1" doc:name="readfileFlow1">
<file:inbound-endpoint path="Test" moveToDirectory="Backup" responseTimeout="10000" doc:name="File"/>
<enricher source="#[(name in payload.data)]" target="#[flowVars.myMap]" doc:name="Message Enricher">
<json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object"/>
</enricher>
<logger message="#[payload.toString()]" level="INFO" doc:name="Logger"/>
</flow>
When I print in logger then I got following output
INFO 2015-04-29 13:01:20,409 [[readfile].readfileFlow1.stage1.02] org.mule.api.processor.LoggerMessageProcessor: org.mule.transport.file.ReceiverFileInputStream@15bc5cc
How can I extract properly all name I tried using for each . Using for each I can extract succesfully. But want to use message enricher. How can I do this using message enricher MVEL??
My json data is as follow..
{
"data":[
{
"id" : "1",
"name": "AAA"
},
{
"id" : "5",
"name": "DDD"
},
{
"id" : "6",
"name": "CCC"
},
]
}