Hello! I am learning Java relatively recently. For the purpose of learning, I wrote a small application consisting of two modules: 1. Spring + Hibernate data in the MySQL database, mapping to JSP, deploying to Tomcat. 2. EJB, data is taken from the same database, deployed on WildFly. I have a question: how to configure the interaction of the two modules through the websocket? For example: the first makes some changes to the database, sends a notification to the second, it pulls up fresh data from the database and displays them to the user. I read different manuals, looked at examples, but did not find something similar. Do not quite understand where to start. I would appreciate any help.
- oneIt is unlikely that they invented the standard use of web sockets for such a task. But he will find a bunch of restful examples, web services or the same ejb without any web shells. The most fashionable - restful services - Sergey
- Websocket is not a suitable protocol. You can do it, but it will be a crutch. - Sergey Gornostaev
- Spring has a well-implemented WebSoket server. Material related in bulk. Spring client too. But, if you use websocket for large messages, you will have to dig deeper with the server settings and headers on the client. In any case, if you need to do long-term asynchronous processing, this method has a number of significant advantages over long polling or rest callback, but there are also disadvantages. - Gleb Kuznetsov
|