Skip to content

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

Closed

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

Activity

  1. spring-projects-issues commented on Nov 13, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

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

  2. added
    type: enhancement
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions