-
Notifications
You must be signed in to change notification settings - Fork 41.2k
use spring-boot-starter-quartz and spring-boot-starter-websocket simultaneously #24448
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
Comments
Previously we had a no-op scheduler and changed it in spring-projects/spring-framework#20737 so that now it return Could anything be done on the Boot side for this, for example to improve how |
@felixu1992 thanks for the report. Could you please share a small sample that demonstrates the problem you've described? You can do so by attaching a zip to this issue or sharing a link to a GitHub repository. |
@snicoll Thank you for your reply,this is a small sample. You can get it form https://oss-blog.felixu.top/demo.zip |
Thanks for the minimal sample @felixu1992 I think this is could be a framework problem after all. With a default
|
@snicoll Thank you for your attention,and feel glad to share thoughts with you. |
After a discussion with Juergen, we concluded that something should be done at the framework level. I've created spring-projects/spring-framework#26271 |
I think so, too, so I started this issue on the Spring Framework, but it was transferred to Spring Boot. |
This issue is now superseded by spring-projects/spring-framework#26271. I've tried the fix and it works as expected now. @felixu1992 you can also give it a try using Spring Framework |
I want to use spring-boot-starter-quartz and spring-boot-starter-websocket simultaneously,but it fails to satisfy my needs, and when I try to use them,some errors as follow appeared.
I have figured out what caused these errors. It is because that there is a logical conflict on the instantiation of Taskscheuler after the procedure of use spring-boot-starter-quartz and spring-boot-starter-websocket simultaneously. spring-wesocket created a NullBean as instantiation of Taskscheduler. when the quartz is applied,the errors would emerge that is:
In org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport#defaultSockJsTaskScheduler
If this condition is not satisfied, it's going to create an instance(NullBean(org.springframework.beans.factory.support.NullBean)) of TaskScheduler here.
So we're going to rely on spring-boot-starter-quartz:
But due to the existence of the Nullbean the above method is impracticable, neither for the creation of a new workable Taskscheduler, but this problem can be tackled in this way:
Or implement WebSocketConfigurer to solve it.
Although we can use the above ways to settle the errors, but they are only temporary .In my opinion,the root cause for the problem is the bug of spring-websocket and so that cause the wrong existence of Nullbean
I think we can use these ways to deal with:
The above mentioned are my immature thoughts ,may be you can solve the errors in a better way,thanks for your attention
The text was updated successfully, but these errors were encountered: