Java – push notifications in spring MVC webapp

I am writing a forum web application using spring MVC I'm just a beginner in spring. Now it's only a week

I need help. Send a notification to user A. user B has commented on his post I have done some research and found that there is a package called CometD that I can use, but I can't find any simple tutorials to let me understand

Can anyone suggest any other package / method to solve my problem? Or if you have any simple comet D tutorials, that's great

Solution

CometD tutorial here: http://docs.cometd.org/tutorials/.

CometD also comes with a demo war file for a built-in chat application that you can use to learn how CometD works, see http://docs.cometd.org/reference/installation.html.

The complete reference document for CometD is here: http://docs.cometd.org/.

Based on experience, I do not recommend using servlet 3.0 asynchronous function to realize chat, because it will exclude the use of websocket

It is better to rely on the CometD framework that can start with websocket (because it is more efficient), and then automatically and transparently back to HTTP if websocket does not work

In similar comments, I do not recommend using websocket method, because websocket does not work in some cases (for example, mobile networks usually do not allow websocket traffic), and it is a too low-level protocol, so you must build your own protocol on websocket (this is a lot of work and not easy to get)

CometD provides you with an easily extensible protocol and automatic transmission fallback function, and has many functions (for example, authorization and authentication and clustering of only two functions are mentioned)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>