简体   繁体   中英

how to update payload in mule esb

I am getting a iso8583 responce from server with some fields like 2,3,7,8 in payload . Now I want update a payload with second filed with different value. How can I do this in mule? I have tried to write a script in groovy but it is not executing..

this is my iso message (which is my payload):

ISO0160000751210B03080014E418000000000000000002897000000000000000000019916051912171405190620001809000000000614012837225UNI000000IDF331512135183102-0000001222358200-0000001222358200+0000000000000000+0000000000000000-0000001222358200INR              INR003FIG015117910100018219

Now i want to update the value in this payload. after parsing the payload it is split as a key value pair. If i use payload.get(2) , second field value will come but I want to update the second field value in payload. How please help me.

What you are looking for is the Message Enricher , can be used as follows:

<enricher target="#[payload[2]]">
    <set-payload value="the new value to set"/>
</enricher>

This would set the value with key 2 in the map to what ever you define within the set-payload within the enricher. It is also possible to use multiple message processors within the enricher using <processor-chain> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM