There is a simple web server on Jetty, the essence of the work is quite simple.
The client sends another user a message in the form of a json string, the server
processes it and writes the message to the database.
Upon request, the user can get the message history with another user. Question:
All this needs to be redone on the Web Socket. I don’t understand how to process requests.
If I will also write messages to the database, then how can the user check if a new message has arrived?
There is an idea to process the message, write it to the database, and then send it to the desired user, but it seems to me that this will not be correct.
- why do you think it will be wrong? - Mikhail Vaysman
- @MikhailVaysman I think it will work slowly, and I have no experience in this, so I decided to find out the answer from more experienced people. - Danil
|