Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
TaskExecutorRegistration.getTaskExecutor() overrides executor properties of a provided ThreadPoolTaskExecutor [SPR-15962] #20514
When configuring the threadpool for the websocket clientOutboundChannel for example I will override public void configureClientOutboundChannel(ChannelRegistration registration). On the ChannelRegistration I can call taskExecutor(taskExecutor) and provide a ThreadPoolTaskExecutor which is set in the the ChannelRegistration's TaskExecutorRegistration.
However, when the getTaskExecutor() method is called on the TaskExecutorRegistration my ThreadPoolTaskExecutor is used, but the default settings for the TaskExecutorRegistration then immediately override whatever was set on the ThreadPoolTaskExecutor I provided.
This doesn't seem like the intended logic. I would expect to either provide the settings to the TaskExecutorRegistration and have it create a ThreadPoolTaskExecutor with those settings for me, or provide my own ThreadPoolTaskExecutor object, but I would not expect to have some settings overridden on the provided ThreadPoolTaskExecutor.
I encountered this in 4.2.9, but the latest source code in Github still seems to have this issue.
Backported to: 4.3.12
Juergen Hoeller commented
Indeed, these defaults are only meant to be applied to a default executor. I've revised the overall implementation to cleanly separate between a default and a user-provided executor, and to only apply user-specified settings (from actual