I am working on a project with [Spring Integration](http://projects.spring.io/spring-integration/). At some point in the message flow I am using a [MongoDB Outbound Channel Adapter](http://docs.spring.io/spring-integration/reference/html/mongodb.html#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?