Skip to content

WebSocketConfigurationSupport.defaultSockJsTaskScheduler adds NoOpScheduler to context that is not usable in any way [SPR-16189] #20737

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 3d6e38b, 6aa6d91

0 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions