You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In what version(s) of Spring Integration are you seeing this issue?
6.2.11
Describe the bug
The custom taskScheduler is not configured for delay handler when using DelayerEndpointSpec#taskScheduler() method.
The default taskScheduler is used instead (IntegrationObjectSupport#getTaskScheduler() - taskScheduler is null)
To Reproduce
Use this code snippet: subscribe(flow -> flow.delay(d -> d.messageGroupId("testDelayer").taskScheduler(myCustomTaskScheduler))).nullChannel();
when the delayer is executed the taskScheduler field is null and the default task scheduler is retrieved (IntegrationObjectSupport#getTaskScheduler())
I need to use this workaround to make it working properly:
Confirmed.
The ConsumerEndpointSpec does set the provided scheduler, but only into an endpoint for this handler.
I guess we just need to override that method on the DelayerEndpointSpec and set scheduler respectively to the handler as well.
I hope the config you provide is just for issue comment purpose.
Otherwise it does not make sense to delay a message just to discard it afterward...
Fixes: #9825
Issue link: #9825
The `DelayerEndpointSpec` extends `ConsumerEndpointSpec` which has a `taskScheduler()` option.
However this is set only to the endpoint for this `MessageHandler`.
* Override `taskScheduler()` method on the `DelayerEndpointSpec` to set
the provided `TaskScheduler` to the `DelayHandler` as well
(cherry picked from commit 12fee0a)
Fixes: #9825
Issue link: #9825
The `DelayerEndpointSpec` extends `ConsumerEndpointSpec` which has a `taskScheduler()` option.
However this is set only to the endpoint for this `MessageHandler`.
* Override `taskScheduler()` method on the `DelayerEndpointSpec` to set
the provided `TaskScheduler` to the `DelayHandler` as well
(cherry picked from commit 12fee0a)
Yes, agree, the code snippet doesn't make sense here, in the real code the other handler is processing the message after a delay.
I’ve simplified it too much :)
In what version(s) of Spring Integration are you seeing this issue?
6.2.11
Describe the bug
The custom taskScheduler is not configured for delay handler when using DelayerEndpointSpec#taskScheduler() method.
The default taskScheduler is used instead (IntegrationObjectSupport#getTaskScheduler() - taskScheduler is null)
To Reproduce
Use this code snippet:
subscribe(flow -> flow.delay(d -> d.messageGroupId("testDelayer").taskScheduler(myCustomTaskScheduler))).nullChannel();
when the delayer is executed the taskScheduler field is null and the default task scheduler is retrieved (IntegrationObjectSupport#getTaskScheduler())
I need to use this workaround to make it working properly:
Expected behavior
It should be possible to configure custom task scheduler using DelayerEndpointSpec#taskScheduler()
The text was updated successfully, but these errors were encountered: