WebSocketConfigurationSupport.defaultSockJsTaskScheduler adds NoOpScheduler to context that is not usable in any way [SPR-16189] #20737
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Ivan Sopov opened SPR-16189 and commented
WebSocketConfigurationSupport.defaultSockJsTaskScheduler() produces TaskScheduler bean and adds it to application context. But if SockJS is not used and not configured - it creates NoOpScheduler that can only throw IllegalStateExceptions. If other component is added to context that requires TaskScheduler it picks that NoOpScheduler and fails with "Unexpected use of scheduler" on it use instead of "No such bean" on creation.
It seems to me that it will be better not to add such NoOpScheduler to application context since it is not usable in any way.
Affects: 5.0.1
Issue Links:
@Bean
("depends on")Referenced from: commits 3d6e38b, 6aa6d91
0 votes, 5 watchers
The text was updated successfully, but these errors were encountered: