Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Nov 13, 2017 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 13, 2017

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Rossen Stoyanchev, this seems somewhat convoluted overall between WebSocketConfigurationSupport and WebSocketMessageBrokerConfigurationSupport... Let's see what we can do about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants