Class ConsumerEndpointSpec<S extends ConsumerEndpointSpec<S,H>,H extends MessageHandler>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,reactor.util.function.Tuple2<F,H>>
org.springframework.integration.dsl.EndpointSpec<S,ConsumerEndpointFactoryBean,H>
org.springframework.integration.dsl.ConsumerEndpointSpec<S,H>
- Type Parameters:
S
- the targetConsumerEndpointSpec
implementation type.H
- the targetMessageHandler
implementation type.
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,H>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
AbstractRouterSpec
,BarrierSpec
,CorrelationHandlerSpec
,DelayerEndpointSpec
,EnricherSpec
,FilterEndpointSpec
,GatewayEndpointSpec
,GenericEndpointSpec
,HeaderEnricherSpec
,ScatterGatherSpec
,SplitterEndpointSpec
public abstract class ConsumerEndpointSpec<S extends ConsumerEndpointSpec<S,H>,H extends MessageHandler> extends EndpointSpec<S,ConsumerEndpointFactoryBean,H>
A
EndpointSpec
for consumer endpoints.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields Modifier and Type Field Description protected List<Advice>
adviceChain
Fields inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handler
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConsumerEndpointSpec(H messageHandler)
-
Method Summary
Modifier and Type Method Description S
advice(Advice... advice)
Configure a list ofAdvice
objects to be applied, in nested order, to the endpoint's handler.S
async(boolean async)
Allow async replies.S
autoStartup(boolean autoStartup)
S
customizeMonoReply(BiFunction<Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)
protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,H>
doGet()
S
handleMessageAdvice(MethodInterceptor... interceptors)
Configure a list ofMethodInterceptor
objects to be applied, in nested order, to the endpoint's handler.S
notPropagatedHeaders(String... headerPatterns)
Set header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy") that will NOT be copied from the inbound message.S
order(int order)
S
phase(int phase)
S
poller(PollerMetadata pollerMetadata)
S
reactive()
Make the consumer endpoint as reactive independently of an input channel.S
reactive(Function<? super reactor.core.publisher.Flux<Message<?>>,? extends org.reactivestreams.Publisher<Message<?>>> reactiveCustomizer)
Make the consumer endpoint as reactive independently of an input channel and apply the provided function into theFlux.transform(Function)
operator.S
requiresReply(boolean requiresReply)
S
role(String role)
Specify the role for the endpoint.S
sendTimeout(long sendTimeout)
S
taskScheduler(TaskScheduler taskScheduler)
Configure aTaskScheduler
for scheduling tasks, for example in the Polling Consumer.S
transactional()
Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.S
transactional(boolean handleMessageAdvice)
Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.S
transactional(TransactionInterceptor transactionInterceptor)
S
transactional(TransactionManager transactionManager)
Specify aTransactionInterceptor
Advice
with the providedPlatformTransactionManager
and defaultDefaultTransactionAttribute
for theMessageHandler
.S
transactional(TransactionManager transactionManager, boolean handleMessageAdvice)
Specify aTransactionInterceptor
Advice
with the providedPlatformTransactionManager
and defaultDefaultTransactionAttribute
for theMessageHandler
.Methods inherited from class org.springframework.integration.dsl.EndpointSpec
assertHandler, getComponentsToRegister, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, poller
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
Constructor Details
-
Method Details
-
phase
- Specified by:
phase
in classEndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>
- Parameters:
phase
- the phase.- Returns:
- the endpoint spec.
- See Also:
SmartLifecycle
-
autoStartup
- Specified by:
autoStartup
in classEndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>
- Parameters:
autoStartup
- the autoStartup.- Returns:
- the endpoint spec
- See Also:
SmartLifecycle
-
poller
- Specified by:
poller
in classEndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>
- Parameters:
pollerMetadata
- the pollerMetadata- Returns:
- the endpoint spec.
- See Also:
AbstractPollingEndpoint
-
reactive
Make the consumer endpoint as reactive independently of an input channel.- Returns:
- the spec
- Since:
- 5.5
-
reactive
public S reactive(Function<? super reactor.core.publisher.Flux<Message<?>>,? extends org.reactivestreams.Publisher<Message<?>>> reactiveCustomizer)Make the consumer endpoint as reactive independently of an input channel and apply the provided function into theFlux.transform(Function)
operator.- Parameters:
reactiveCustomizer
- the function to transformFlux
for the input channel.- Returns:
- the spec
- Since:
- 5.5
-
role
Description copied from class:EndpointSpec
Specify the role for the endpoint. Such endpoints can be started/stopped as a group.- Specified by:
role
in classEndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>
- Parameters:
role
- the role for this endpoint.- Returns:
- the endpoint spec
- See Also:
SmartLifecycle
,SmartLifecycleRoleController
-
taskScheduler
Configure aTaskScheduler
for scheduling tasks, for example in the Polling Consumer. By default the globalThreadPoolTaskScheduler
bean is used. This configuration is useful when there are requirements to dedicate particular threads for polling task, for example.- Parameters:
taskScheduler
- theTaskScheduler
to use.- Returns:
- the endpoint spec.
- See Also:
IntegrationContextUtils.getTaskScheduler(org.springframework.beans.factory.BeanFactory)
-
handleMessageAdvice
Configure a list ofMethodInterceptor
objects to be applied, in nested order, to the endpoint's handler. The advice objects are applied to thehandleMessage()
method and therefore to the whole sub-flow afterwards.- Parameters:
interceptors
- the advice chain.- Returns:
- the endpoint spec.
- Since:
- 5.3
-
advice
Configure a list ofAdvice
objects to be applied, in nested order, to the endpoint's handler. The advice objects are applied only to the handler.- Parameters:
advice
- the advice chain.- Returns:
- the endpoint spec.
-
transactional
Specify aTransactionInterceptor
Advice
with the providedPlatformTransactionManager
and defaultDefaultTransactionAttribute
for theMessageHandler
.- Parameters:
transactionManager
- theTransactionManager
to use.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptor
Advice
with the providedPlatformTransactionManager
and defaultDefaultTransactionAttribute
for theMessageHandler
.- Parameters:
transactionManager
- theTransactionManager
to use.handleMessageAdvice
- the flag to indicate the targetAdvice
type:false
- regularTransactionInterceptor
;true
-TransactionHandleMessageAdvice
extension.- Returns:
- the spec.
-
transactional
- Parameters:
transactionInterceptor
- theTransactionInterceptor
to use.- Returns:
- the spec.
- See Also:
TransactionInterceptorBuilder
-
transactional
Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.- Parameters:
handleMessageAdvice
- the flag to indicate the targetAdvice
type:false
- regularTransactionInterceptor
;true
-TransactionHandleMessageAdvice
extension.- Returns:
- the spec.
-
customizeMonoReply
public S customizeMonoReply(BiFunction<Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)- Parameters:
replyCustomizer
- theBiFunction
to propagate intoReactiveRequestHandlerAdvice
.- Returns:
- the spec.
- Since:
- 5.3
- See Also:
ReactiveRequestHandlerAdvice
-
requiresReply
- Parameters:
requiresReply
- the requiresReply.- Returns:
- the endpoint spec.
- See Also:
AbstractReplyProducingMessageHandler.setRequiresReply(boolean)
-
sendTimeout
- Parameters:
sendTimeout
- the send timeout.- Returns:
- the endpoint spec.
- See Also:
AbstractMessageProducingHandler.setSendTimeout(long)
-
order
- Parameters:
order
- the order.- Returns:
- the endpoint spec.
- See Also:
MessageHandlerSupport.setOrder(int)
-
async
Allow async replies. If the handler reply is aorg.springframework.util.concurrent.ListenableFuture
, send the output when it is satisfied rather than sending the future as the result. Ignored for handler return types other thanListenableFuture
.- Parameters:
async
- true to allow.- Returns:
- the endpoint spec.
- See Also:
AbstractMessageProducingHandler.setAsync(boolean)
-
notPropagatedHeaders
Set header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy") that will NOT be copied from the inbound message. At least one pattern as "*" means do not copy headers at all.- Parameters:
headerPatterns
- the headers to not propagate from the inbound message.- Returns:
- the endpoint spec.
- See Also:
AbstractMessageProducingHandler.setNotPropagatedHeaders(String...)
-
doGet
- Overrides:
doGet
in classEndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>
-