I am using Mule 4 and Anypoint 7.
In my flow I want to insert records into a database but still keep the original payload in the message.
Previously I would have placed the database connector into an enricher scope so that the original payload is not replaced after the database action has completed.
How can I do this using Mule 4?
I do have the alternative of saving the payload as a variable and then use set payload after the database action but there are a few different database actions and thought the enricher scope made the flow look cleaner so just wanted to see if the functionality was still there somewhere.
Thanks
As you've seen, Enrichers are no longer a scope in Mule 4. We need to use Targets now to achieve similar functionality. Go to the 'Advanced' tab of the Insert configuration and in the Output section specify the 'Target Variable' and 'Target Value'. This provides the same functionality as an enricher.