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 targetConsumerEndpointSpecimplementation type.H- the targetMessageHandlerimplementation 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,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
FieldsFields inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handlerFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConfigure a list ofAdviceobjects 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 ofMethodInterceptorobjects 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 aTaskSchedulerfor scheduling tasks, for example in the Polling Consumer.Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor theMessageHandler.transactional(boolean handleMessageAdvice) Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor theMessageHandler.transactional(TransactionInterceptor transactionInterceptor) transactional(TransactionManager transactionManager) Specify aTransactionInterceptorAdvicewith the providedPlatformTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.transactional(TransactionManager transactionManager, boolean handleMessageAdvice) Specify aTransactionInterceptorAdvicewith the providedPlatformTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.Methods inherited from class org.springframework.integration.dsl.EndpointSpec
assertHandler, getComponentsToRegister, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, pollerMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, get, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
adviceChain
-
-
Constructor Details
-
ConsumerEndpointSpec
-
-
Method Details
-
phase
- Specified by:
phasein classEndpointSpec<S extends ConsumerEndpointSpec<S,H>, ConsumerEndpointFactoryBean, H extends MessageHandler> - Parameters:
phase- the phase.- Returns:
- the endpoint spec.
- See Also:
-
autoStartup
- Specified by:
autoStartupin classEndpointSpec<S extends ConsumerEndpointSpec<S,H>, ConsumerEndpointFactoryBean, H extends MessageHandler> - Parameters:
autoStartup- the autoStartup.- Returns:
- the endpoint spec
- See Also:
-
poller
- Specified by:
pollerin 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 transformFluxfor the input channel.- Returns:
- the spec
- Since:
- 5.5
-
role
Description copied from class:EndpointSpecSpecify the role for the endpoint. Such endpoints can be started/stopped as a group.- Specified by:
rolein 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 aTaskSchedulerfor scheduling tasks, for example in the Polling Consumer. By default the globalThreadPoolTaskSchedulerbean is used. This configuration is useful when there are requirements to dedicate particular threads for polling task, for example.- Parameters:
taskScheduler- theTaskSchedulerto use.- Returns:
- the endpoint spec.
- See Also:
-
handleMessageAdvice
Configure a list ofMethodInterceptorobjects 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 ofAdviceobjects 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 aTransactionInterceptorAdvicewith the providedPlatformTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.- Parameters:
transactionManager- theTransactionManagerto use.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptorAdvicewith the providedPlatformTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.- Parameters:
transactionManager- theTransactionManagerto use.handleMessageAdvice- the flag to indicate the targetAdvicetype:false- regularTransactionInterceptor;true-TransactionHandleMessageAdviceextension.- Returns:
- the spec.
-
transactional
- Parameters:
transactionInterceptor- theTransactionInterceptorto use.- Returns:
- the spec.
- See Also:
-
transactional
Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor theMessageHandler.- Returns:
- the spec.
-
transactional
Specify aTransactionInterceptorAdvicewith defaultPlatformTransactionManagerandDefaultTransactionAttributefor theMessageHandler.- Parameters:
handleMessageAdvice- the flag to indicate the targetAdvicetype:false- regularTransactionInterceptor;true-TransactionHandleMessageAdviceextension.- 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- theBiFunctionto 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 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:
-
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:
doGetin classEndpointSpec<S extends ConsumerEndpointSpec<S,H>, ConsumerEndpointFactoryBean, H extends MessageHandler>
-