Class ReactiveStreamsConsumer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.ReactiveStreamsConsumer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
,ExpressionCapable
,IntegrationConsumer
,NamedComponent
,ManageableLifecycle
,ManageableSmartLifecycle
public class ReactiveStreamsConsumer extends AbstractEndpoint implements IntegrationConsumer
An
AbstractEndpoint
implementation for Reactive Streams subscription into an
input channel and reactive consumption of messages from that channel.- Since:
- 5.0
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
Constructors Constructor Description ReactiveStreamsConsumer(MessageChannel inputChannel, org.reactivestreams.Subscriber<Message<?>> subscriber)
ReactiveStreamsConsumer(MessageChannel inputChannel, MessageHandler messageHandler)
ReactiveStreamsConsumer(MessageChannel inputChannel, ReactiveMessageHandler reactiveMessageHandler)
Instantiate an endpoint based on the providedMessageChannel
andReactiveMessageHandler
. -
Method Summary
Modifier and Type Method Description protected void
doStart()
Subclasses must implement this method with the start behavior.protected void
doStop()
Subclasses must implement this method with the stop behavior.MessageHandler
getHandler()
Return the consumer's handler.MessageChannel
getInputChannel()
Return the input channel.MessageChannel
getOutputChannel()
Return the output channel (may be null).protected void
onInit()
Subclasses may implement this for initialization logic.void
setErrorHandler(ErrorHandler errorHandler)
void
setReactiveCustomizer(Function<? super reactor.core.publisher.Flux<Message<?>>,? extends org.reactivestreams.Publisher<Message<?>>> reactiveCustomizer)
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName, getComponentType
-
Constructor Details
-
ReactiveStreamsConsumer
-
ReactiveStreamsConsumer
public ReactiveStreamsConsumer(MessageChannel inputChannel, org.reactivestreams.Subscriber<Message<?>> subscriber) -
ReactiveStreamsConsumer
public ReactiveStreamsConsumer(MessageChannel inputChannel, ReactiveMessageHandler reactiveMessageHandler)Instantiate an endpoint based on the providedMessageChannel
andReactiveMessageHandler
.- Parameters:
inputChannel
- the channel to consume in reactive manner.reactiveMessageHandler
- theReactiveMessageHandler
to process messages.- Since:
- 5.3
-
-
Method Details
-
setErrorHandler
-
setReactiveCustomizer
-
getInputChannel
Description copied from interface:IntegrationConsumer
Return the input channel.- Specified by:
getInputChannel
in interfaceIntegrationConsumer
- Returns:
- the input channel.
-
getOutputChannel
Description copied from interface:IntegrationConsumer
Return the output channel (may be null).- Specified by:
getOutputChannel
in interfaceIntegrationConsumer
- Returns:
- the output channel.
-
getHandler
Description copied from interface:IntegrationConsumer
Return the consumer's handler.- Specified by:
getHandler
in interfaceIntegrationConsumer
- Returns:
- the handler.
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classAbstractEndpoint
-
doStart
protected void doStart()Description copied from class:AbstractEndpoint
Subclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock
.- Specified by:
doStart
in classAbstractEndpoint
-
doStop
protected void doStop()Description copied from class:AbstractEndpoint
Subclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock
.- Specified by:
doStop
in classAbstractEndpoint
-