How to use WebSocket? in the Service layer

the current business has a system similar to "second kill". After clicking the second kill, the user first generates the order, and notifies the front desk after the order is generated. This notification is done using WebSocket. How can I call WebSocket to send a message to the front desk after the order is generated? The order is processed in the Service layer. I don"t want to use foreground polling or background polling. The framework is that SpringBoot, cannot directly inject WebSocket into the Service layer

Sep.16,2021

since the WebSocket notification module can exist independently, you can create a new accessibility class to inject WebSocket, and provide a method to send messages. If you need to use it, you can inject the tool class ~

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea49de-1cef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea49de-1cef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?