Class MongoDbMessageSource

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, MessageSource<Object>, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement

public class MongoDbMessageSource
extends AbstractMongoDbMessageSource<Object>
An instance of MessageSource which returns a Message with a payload which is the result of execution of a Query. When expectSingleResult is false (default), the MongoDb Query is executed using MongoOperations.find(Query, Class) method which returns a List. The returned List will be used as the payload of the Message returned by the {AbstractMessageSource.receive() method. An empty List is treated as null, thus resulting in no Message returned by the {AbstractMessageSource.receive() method.

When expectSingleResult is true, the MongoOperations.findOne(Query, Class) is used instead, and the message payload will be the single object returned from the query.

Amol Nayak, Oleg Zhurakousky, Yaron Yamin, Artem Bilan, Gary Russell