I am setting a workflow using Spring integration. Basically is this:
Poll Database → Split rows → HTTP Post to web API → Filter: (if OK) → Write To File → Delete row from DDBB
I am using a JDBC poller and an HTTP outbound gateway. I've managed to read the database, split the results to handle the rows one by one, and then post the data to a rest service, using json.
But after that, in the output of the http gateway, i get the POST result.
In this use case, i'd need to have the original object i send to the Http gateway, because i have to write some of its data to a text file, and then use its ID to delete from the original record in the table table.
Is there any way to make the HTTP gateway output include both the POST result and the original POJO it receives in the input?
Add a header enricher before the gateway to copy the payload into a header; you can then reference the header later in the flow.