S - the target ConsumerEndpointSpec implementation type.H - the target MessageHandler implementation type.public abstract class ConsumerEndpointSpec<S extends ConsumerEndpointSpec<S,H>,H extends MessageHandler> extends EndpointSpec<S,ConsumerEndpointFactoryBean,H>
EndpointSpec for consumer endpoints.| Modifier and Type | Field and Description |
|---|---|
protected List<Advice> |
adviceChain |
componentsToRegister, endpointFactoryBean, handlerPARSER, targetloggerDEFAULT_PHASEOBJECT_TYPE_ATTRIBUTE| Modifier | Constructor and Description |
|---|---|
protected |
ConsumerEndpointSpec(H messageHandler) |
| Modifier and Type | Method and Description |
|---|---|
S |
advice(Advice... advice)
Configure a list of
Advice 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(java.util.function.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 of
MethodInterceptor 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 |
requiresReply(boolean requiresReply) |
S |
role(String role)
Specify the role for the endpoint.
|
S |
sendTimeout(long sendTimeout) |
S |
taskScheduler(TaskScheduler taskScheduler)
Configure a
TaskScheduler for scheduling tasks, for example in the
Polling Consumer. |
S |
transactional()
Specify a
TransactionInterceptor Advice with default
PlatformTransactionManager and
DefaultTransactionAttribute
for the
MessageHandler. |
S |
transactional(boolean handleMessageAdvice)
Specify a
TransactionInterceptor Advice with default
PlatformTransactionManager and
DefaultTransactionAttribute
for the MessageHandler. |
S |
transactional(TransactionInterceptor transactionInterceptor)
|
S |
transactional(TransactionManager transactionManager)
Specify a
TransactionInterceptor Advice with the provided
PlatformTransactionManager and default
DefaultTransactionAttribute
for the MessageHandler. |
S |
transactional(TransactionManager transactionManager,
boolean handleMessageAdvice)
Specify a
TransactionInterceptor Advice with the provided
PlatformTransactionManager and default
DefaultTransactionAttribute
for the MessageHandler. |
assertHandler, getComponentsToRegister, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, poller_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopafterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonprotected ConsumerEndpointSpec(H messageHandler)
public S phase(int phase)
phase in class EndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>phase - the phase.SmartLifecyclepublic S autoStartup(boolean autoStartup)
autoStartup in class EndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>autoStartup - the autoStartup.SmartLifecyclepublic S poller(PollerMetadata pollerMetadata)
poller in class EndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>pollerMetadata - the pollerMetadataAbstractPollingEndpointpublic S role(String role)
EndpointSpecrole in class EndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>role - the role for this endpoint.SmartLifecycle,
SmartLifecycleRoleControllerpublic S taskScheduler(TaskScheduler taskScheduler)
TaskScheduler for scheduling tasks, for example in the
Polling Consumer. By default the global ThreadPoolTaskScheduler bean is used.
This configuration is useful when there are requirements to dedicate particular threads
for polling task, for example.taskScheduler - the TaskScheduler to use.IntegrationContextUtils.getTaskScheduler(org.springframework.beans.factory.BeanFactory)public S handleMessageAdvice(MethodInterceptor... interceptors)
MethodInterceptor objects to be applied, in nested order, to the
endpoint's handler. The advice objects are applied to the handleMessage() method
and therefore to the whole sub-flow afterwards.interceptors - the advice chain.public S advice(Advice... advice)
Advice objects to be applied, in nested order, to the
endpoint's handler. The advice objects are applied only to the handler.advice - the advice chain.public S transactional(TransactionManager transactionManager)
TransactionInterceptor Advice with the provided
PlatformTransactionManager and default
DefaultTransactionAttribute
for the MessageHandler.transactionManager - the TransactionManager to use.public S transactional(TransactionManager transactionManager, boolean handleMessageAdvice)
TransactionInterceptor Advice with the provided
PlatformTransactionManager and default
DefaultTransactionAttribute
for the MessageHandler.transactionManager - the TransactionManager to use.handleMessageAdvice - the flag to indicate the target Advice type:
false - regular TransactionInterceptor; true -
TransactionHandleMessageAdvice
extension.public S transactional(TransactionInterceptor transactionInterceptor)
transactionInterceptor - the TransactionInterceptor to use.TransactionInterceptorBuilderpublic S transactional()
TransactionInterceptor Advice with default
PlatformTransactionManager and
DefaultTransactionAttribute
for the
MessageHandler.public S transactional(boolean handleMessageAdvice)
TransactionInterceptor Advice with default
PlatformTransactionManager and
DefaultTransactionAttribute
for the MessageHandler.handleMessageAdvice - the flag to indicate the target Advice type:
false - regular TransactionInterceptor; true -
TransactionHandleMessageAdvice
extension.public S customizeMonoReply(java.util.function.BiFunction<Message<?>,reactor.core.publisher.Mono<?>,org.reactivestreams.Publisher<?>> replyCustomizer)
replyCustomizer - the BiFunction to propagate into ReactiveRequestHandlerAdvice.ReactiveRequestHandlerAdvicepublic S requiresReply(boolean requiresReply)
requiresReply - the requiresReply.AbstractReplyProducingMessageHandler.setRequiresReply(boolean)public S sendTimeout(long sendTimeout)
sendTimeout - the send timeout.AbstractMessageProducingHandler.setSendTimeout(long)public S order(int order)
order - the order.MessageHandlerSupport.setOrder(int)public S async(boolean async)
org.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 than
ListenableFuture.async - true to allow.AbstractMessageProducingHandler.setAsync(boolean)public S notPropagatedHeaders(String... headerPatterns)
headerPatterns - the headers to not propagate from the inbound message.AbstractMessageProducingHandler.setNotPropagatedHeaders(String...)protected reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,H> doGet()
doGet in class EndpointSpec<S extends ConsumerEndpointSpec<S,H>,ConsumerEndpointFactoryBean,H extends MessageHandler>