Monitor the online status of users based on the connection pool monitoring component druid.
Original article: Monitoring users' online status based on druid, a connection pool monitoring component
Source code: http://www.zuidaima.com/share/1550463574248448.htm
Let me share some code. Recently, I have been monitoring the online status of users and encountered some problems when handling abnormal and unexpected exit (such as direct shutdown and sudden power failure) of client users. I have found many methods and I don't feel very good. I saw a new connection pool management tool yesterday ~ It should be said that it is currently the best --- druid, which is not introduced here. I will give you a connection. If you want to learn it, you can go and see it. It is open-source. There is a way in the http://code.alibabatech.com/wiki/display/Druid/Home druid to get the information of the session in the current project in real time.
Now that we can get the real-time situation of the session, we can handle it. Below are several key configuration files and code first-time sharing. Find me in a group that you don't understand.