Class DelayerEndpointSpec
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<DelayerEndpointSpec,DelayHandler>
org.springframework.integration.dsl.DelayerEndpointSpec
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<reactor.util.function.Tuple2<ConsumerEndpointFactoryBean,DelayHandler>>,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,ComponentsRegistration
public class DelayerEndpointSpec extends ConsumerEndpointSpec<DelayerEndpointSpec,DelayHandler>
A
ConsumerEndpointSpec for a DelayHandler.- Since:
- 5.0
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.EndpointSpec
componentsToRegister, endpointFactoryBean, handlerFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target -
Constructor Summary
Constructors Modifier Constructor Description protectedDelayerEndpointSpec(DelayHandler delayHandler) -
Method Summary
Modifier and Type Method Description DelayerEndpointSpecdefaultDelay(long defaultDelay)DelayerEndpointSpecdelayedAdvice(org.aopalliance.aop.Advice... advice)Configure a list ofAdviceobjects that will be applied, in nested order, when delayed messages are sent.DelayerEndpointSpecdelayedMessageErrorChannel(java.lang.String channel)Set a message channel name to which anErrorMessagewill be sent if sending the released message fails.DelayerEndpointSpecdelayedMessageErrorChannel(org.springframework.messaging.MessageChannel channel)Set a message channel to which anErrorMessagewill be sent if sending the released message fails.DelayerEndpointSpecdelayExpression(java.lang.String delayExpression)DelayerEndpointSpecdelayExpression(org.springframework.expression.Expression delayExpression)<P> DelayerEndpointSpecdelayFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.Object> delayFunction)Specify the function to determine delay value againstMessage.DelayerEndpointSpecignoreExpressionFailures(boolean ignoreExpressionFailures)DelayerEndpointSpecmaxAttempts(int maxAttempts)Set the maximum number of release attempts for when message release fails.DelayerEndpointSpecmessageStore(MessageGroupStore messageStore)DelayerEndpointSpecretryDelay(long retryDelay)Set an additional delay to apply when retrying after a release failure.DelayerEndpointSpectransactionalRelease()Specify aTransactionInterceptorAdvicewith defaultTransactionManagerandDefaultTransactionAttributefor theMessageHandler.DelayerEndpointSpectransactionalRelease(org.springframework.transaction.interceptor.TransactionInterceptor transactionInterceptor)Specify aTransactionInterceptorAdvicefor theMessageHandler.DelayerEndpointSpectransactionalRelease(org.springframework.transaction.TransactionManager transactionManager)Specify aTransactionInterceptorAdvicewith the providedTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.Methods inherited from class org.springframework.integration.dsl.ConsumerEndpointSpec
advice, async, autoStartup, customizeMonoReply, doGet, handleMessageAdvice, notPropagatedHeaders, order, phase, poller, requiresReply, role, sendTimeout, taskScheduler, transactional, transactional, transactional, transactional, transactionalMethods inherited from class org.springframework.integration.dsl.EndpointSpec
assertHandler, getComponentsToRegister, id, obtainInputChannelFromFlow, obtainInputChannelFromFlow, poller, pollerMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
-
Constructor Details
-
Method Details
-
defaultDelay
- Parameters:
defaultDelay- the defaultDelay.- Returns:
- the endpoint spec.
- See Also:
DelayHandler.setDefaultDelay(long)
-
ignoreExpressionFailures
- Parameters:
ignoreExpressionFailures- the ignoreExpressionFailures.- Returns:
- the endpoint spec.
- See Also:
DelayHandler.setIgnoreExpressionFailures(boolean)
-
messageStore
- Parameters:
messageStore- the message store.- Returns:
- the endpoint spec.
-
delayedAdvice
Configure a list ofAdviceobjects that will be applied, in nested order, when delayed messages are sent.- Parameters:
advice- the advice chain.- Returns:
- the endpoint spec.
-
delayExpression
public DelayerEndpointSpec delayExpression(org.springframework.expression.Expression delayExpression) -
delayExpression
-
delayedMessageErrorChannel
public DelayerEndpointSpec delayedMessageErrorChannel(org.springframework.messaging.MessageChannel channel)Set a message channel to which anErrorMessagewill be sent if sending the released message fails. If the error flow returns normally, the release is complete. If the error flow throws an exception, the release will be re-attempted. If there is a transaction advice on the release task, the error flow is called within the transaction.- Parameters:
channel- the channel.- Returns:
- the endpoint spec.
- Since:
- 5.0.8
- See Also:
maxAttempts(int),retryDelay(long)
-
delayedMessageErrorChannel
Set a message channel name to which anErrorMessagewill be sent if sending the released message fails. If the error flow returns normally, the release is complete. If the error flow throws an exception, the release will be re-attempted. If there is a transaction advice on the release task, the error flow is called within the transaction.- Parameters:
channel- the channel name.- Returns:
- the endpoint spec.
- Since:
- 5.0.8
- See Also:
maxAttempts(int),retryDelay(long)
-
maxAttempts
Set the maximum number of release attempts for when message release fails. Default 5.- Parameters:
maxAttempts- the max attempts.- Returns:
- the endpoint spec.
- Since:
- 5.0.8
- See Also:
retryDelay(long)
-
retryDelay
Set an additional delay to apply when retrying after a release failure. Default 1000L.- Parameters:
retryDelay- the retry delay.- Returns:
- the endpoint spec.
- Since:
- 5.0.8
- See Also:
maxAttempts(int)
-
transactionalRelease
Specify aTransactionInterceptorAdvicewith defaultTransactionManagerandDefaultTransactionAttributefor theMessageHandler.- Returns:
- the spec.
- Since:
- 5.0.8
-
transactionalRelease
public DelayerEndpointSpec transactionalRelease(org.springframework.transaction.interceptor.TransactionInterceptor transactionInterceptor)Specify aTransactionInterceptorAdvicefor theMessageHandler.- Parameters:
transactionInterceptor- theTransactionInterceptorto use.- Returns:
- the spec.
- Since:
- 5.0.8
- See Also:
TransactionInterceptorBuilder
-
transactionalRelease
public DelayerEndpointSpec transactionalRelease(org.springframework.transaction.TransactionManager transactionManager)Specify aTransactionInterceptorAdvicewith the providedTransactionManagerand defaultDefaultTransactionAttributefor theMessageHandler.- Parameters:
transactionManager- theTransactionManagerto use.- Returns:
- the spec.
- Since:
- 5.2.5
-
delayFunction
public <P> DelayerEndpointSpec delayFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.Object> delayFunction)Specify the function to determine delay value againstMessage. Typically used with a Java 8 Lambda expression:.<Foo>delay("delayer", m -> m.getPayload().getDate(), c -> c.advice(this.delayedAdvice).messageStore(this.messageStore()))- Type Parameters:
P- the payload type.- Parameters:
delayFunction- theFunctionto determine delay.- Returns:
- the endpoint spec.
-