Interface MessageCollectionCallback<T>
- Type Parameters:
- T- the expected item type.
- All Superinterfaces:
- CollectionCallback<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MessageCollectionCallback<T> extends CollectionCallback<T>
The callback to be used with the 
MongoDbOutboundGateway
 as an alternative to other query options on the gateway.
 
 Plays the same role as standard CollectionCallback,
 but with Message<?> requestMessage context during handleMessage()
 process in the MongoDbOutboundGateway.
- Since:
- 5.0.11
- Author:
- Artem Bilan
- See Also:
- CollectionCallback
- 
Method SummaryModifier and Type Method Description default TdoInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection)TdoInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection, Message<?> requestMessage)Perform a Mongo operation in the collection using request message as a context.
- 
Method Details- 
doInCollection@Nullable T doInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection, Message<?> requestMessage) throws com.mongodb.MongoException, DataAccessExceptionPerform a Mongo operation in the collection using request message as a context.- Parameters:
- collection- never null.
- requestMessage- the request message ot use for operations
- Returns:
- can be null.
- Throws:
- com.mongodb.MongoException- the MongoDB-specific exception
- DataAccessException- the data access exception
 
- 
doInCollectiondefault T doInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection) throws com.mongodb.MongoException, DataAccessException- Specified by:
- doInCollectionin interface- CollectionCallback<T>
- Throws:
- com.mongodb.MongoException
- DataAccessException
 
 
-