public class MongoDbChangeStreamMessageProducer extends MessageProducerSupport
MessageProducerSupport
for MongoDB Change Stream implementation.
The functionality is based on the
ReactiveMongoOperations.changeStream(String, ChangeStreamOptions, Class)
and MessageProducerSupport.subscribeToPublisher(org.reactivestreams.Publisher)
consumption.lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
DEFAULT_PHASE
Constructor and Description |
---|
MongoDbChangeStreamMessageProducer(ReactiveMongoOperations mongoOperations)
Create an instance based on the provided
ReactiveMongoOperations . |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Take no action by default.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
void |
setCollection(String collection)
Specify a collection name to track change events from.
|
void |
setDomainType(Class<?> domainType)
Specify an object type to convert an event body to.
|
void |
setExtractBody(boolean extractBody)
Configure this channel adapter to build a
Message to produce
with a payload based on a ChangeStreamEvent.getBody() (by default)
or use a whole ChangeStreamEvent as a payload. |
void |
setOptions(ChangeStreamOptions options)
Specify a
ChangeStreamOptions . |
afterSingletonsInstantiated, buildErrorMessage, doStop, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, onInit, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBeanName, getComponentName
public MongoDbChangeStreamMessageProducer(ReactiveMongoOperations mongoOperations)
ReactiveMongoOperations
.mongoOperations
- the ReactiveMongoOperations
to use.ReactiveMongoOperations.changeStream(String, ChangeStreamOptions, Class)
public void setDomainType(Class<?> domainType)
Document
class.domainType
- the class for event body conversion.ReactiveMongoOperations.changeStream(String, ChangeStreamOptions, Class)
public void setCollection(String collection)
mongoOperations
configured database.collection
- a collection to use.ReactiveMongoOperations.changeStream(String, ChangeStreamOptions, Class)
public void setOptions(ChangeStreamOptions options)
ChangeStreamOptions
.options
- the ChangeStreamOptions
to use.ReactiveMongoOperations.changeStream(String, ChangeStreamOptions, Class)
public void setExtractBody(boolean extractBody)
Message
to produce
with a payload based on a ChangeStreamEvent.getBody()
(by default)
or use a whole ChangeStreamEvent
as a payload.extractBody
- to extract ChangeStreamEvent.getBody()
or not.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void doStart()
MessageProducerSupport
doStart
in class MessageProducerSupport