I am working on a project with Spring Integration. At some point in the message flow I am using a MongoDB Outbound Channel Adapter to save the payloads into my mongodb database.
Is there a way that I can immediately get the id of the documents as they get inserted? Basically, just after insertion of a document I need its id to be passed on to another channel for further processing. What is the best approach to achieve this leveraging the Spring Integration infrastructure?