In my opinion, your application has this responsive routine, that is, doing something automatically when any action occurs. Correct?
If your web server supports it, I suggest you use WebSocket
to do exactly what you need.
The client, connecting to your application will create a persistent connection , which will exist while it is logged in. This way, you can respond from the server to a certain (or multiple) client whenever the routine you expect is executed.
You can also use Spring-WebSocket
to make it easier to implement. You can also use some APIs such as SocketJS
or Socket.io
in Javascript.
Hug.
The Spring Framework provides a WebSocket API designed to adapt to
various WebSocket engines. Currently the list includes WebSocket
runtimes such as Tomcat 7.0.47+, Jetty 9.1+, GlassFish 4.1+, WebLogic
12.1.3+, and Undertow 1.0+ (and WildFly 8.0+). Additional support may be added as more WebSocket runtimes become available.
Sources: