Explain in detail how spring integrates Mina to realize active push on the server (including heartbeat detection)

This paper introduces the implementation of active push (including heartbeat detection) by spring integrated Mina, which is shared with you as follows:

Server

1. When integrating Mina with conventional spring projects, POM The following configuration needs to be added to XML:

Note the configuration of Mina core here. If an error is reported after the above dependency is introduced into the project: missing artifact XXX bundle, it needs to be in POM Add the following plug-in configuration between plugins of XML:

2. Filter1: codec, which implements the protocolcodecfactory decoding factory

The textlineencoder codec provided by Mina is used here. This codec supports the use of fixed length or fixed separator to distinguish the upper and lower messages. If you want to use a custom protocol, you need to write your own decoder. To use websocket, you also need to rewrite the decoder. There is an open source project on JIRA about the combination of Mina and websocket https://issues.apache.org/jira/browse/DIRMINA-907 , a codec supporting websocket is specially written for Mina, which can be used for personal test... This part is not the focus of this paper.

In response to everyone's needs, the engineering code has finally taken time to put it in GitHub! https://github.com/smile326/minaSpring

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
分享
二维码
< <上一篇
下一篇>>