Class ConsumerEndpointSpec<S extends ConsumerEndpointSpec<S,H>,H extends MessageHandler>
java.lang.Object
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:
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
,HeaderFilterSpec
,ScatterGatherSpec
,SplitterSpec
,TransformerEndpointSpec
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 inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handler
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConfigure a list ofAdvice
objects to be applied, in nested order, to the endpoint's handler.async
(boolean async) Allow async replies.autoStartup
(boolean autoStartup) <T,
V> S customizeMonoReply
(BiFunction<Message<?>, reactor.core.publisher.Mono<T>, org.reactivestreams.Publisher<V>> replyCustomizer) protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,
H> doGet()
handleMessageAdvice
(MethodInterceptor... interceptors) Configure a list ofMethodInterceptor
objects to be applied, in nested order, to the endpoint's handler.notPropagatedHeaders
(String... headerPatterns) Set header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy") that will NOT be copied from the inbound message.order
(int order) phase
(int phase) poller
(PollerMetadata pollerMetadata) reactive()
Make the consumer endpoint as reactive independently of an input channel.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.requiresReply
(boolean requiresReply) Specify the role for the endpoint.sendTimeout
(long sendTimeout) taskScheduler
(TaskScheduler taskScheduler) Configure aTaskScheduler
for scheduling tasks, for example in the Polling Consumer.Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.transactional
(boolean handleMessageAdvice) Specify aTransactionInterceptor
Advice
with defaultPlatformTransactionManager
andDefaultTransactionAttribute
for theMessageHandler
.transactional
(TransactionInterceptor transactionInterceptor) transactional
(TransactionManager transactionManager) Specify aTransactionInterceptor
Advice
with the providedPlatformTransactionManager
and defaultDefaultTransactionAttribute
for theMessageHandler
.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, afterPropertiesSet, destroy, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
adviceChain
-
-
Constructor Details
-
ConsumerEndpointSpec
-
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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 <T,V> S customizeMonoReply(BiFunction<Message<?>, reactor.core.publisher.Mono<T>, org.reactivestreams.Publisher<V>> replyCustomizer) - Type Parameters:
T
- inbound reply payload.V
- outbound reply payload.- Parameters:
replyCustomizer
- theBiFunction
to propagate intoReactiveRequestHandlerAdvice
.- Returns:
- the spec.
- Since:
- 5.3
- See Also:
-
requiresReply
- Parameters:
requiresReply
- the requiresReply.- Returns:
- the endpoint spec.
- See Also:
-
sendTimeout
- Parameters:
sendTimeout
- the send timeout.- Returns:
- the endpoint spec.
- See Also:
-
order
- Parameters:
order
- the order.- Returns:
- the endpoint spec.
- See Also:
-
async
Allow async replies. If the handler reply is aCompletableFuture
, send the output when it is satisfied rather than sending the future as the result. Ignored for handler return types other thanCompletableFuture
.- Parameters:
async
- true to allow.- Returns:
- the endpoint spec.
- See Also:
-
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:
-
doGet
- Overrides:
doGet
in classEndpointSpec<S extends ConsumerEndpointSpec<S,
H>, ConsumerEndpointFactoryBean, H extends MessageHandler>
-