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.
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:
-
Method Summary
Modifier and TypeMethodDescriptiondefault TdoInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection) @Nullable 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, DataAccessException Perform 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 exceptionDataAccessException- the data access exception
-
doInCollection
default T doInCollection(com.mongodb.client.MongoCollection<org.bson.Document> collection) throws com.mongodb.MongoException, DataAccessException - Specified by:
doInCollectionin interfaceCollectionCallback<T>- Throws:
com.mongodb.MongoExceptionDataAccessException
-