Can not Extract json array properly in message Enricher mule esb -
i tried extract json array data using message enricher. in output got object data.how can fetch properly?
following 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 object"/> </enricher> <logger message="#[payload.tostring()]" level="info" doc:name="logger"/> </flow>
when print in logger 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 extract name tried using each . using each can extract succesfully. want use message enricher. how can using message enricher mvel??
my json data follow..
{ "data":[ { "id" : "1", "name": "aaa" }, { "id" : "5", "name": "ddd" }, { "id" : "6", "name": "ccc" }, ] }
i have done this.. silly mistake made.. following answer
<logger message="#[flowvars.mymap]" level="info" doc:name="logger"/>
Comments
Post a Comment