How to do guaranteed message delivery with java client SignalR?

五迷三道 提交于 2019-12-25 19:16:32

问题


I use SignalR on my Android app to exchange messages. Everything works fine, but I just do not know how to resend the message I sent when disconnected from the Internet when I connect to the Internet.

please help me

i I kept the messages in the list until after connect to internet they were sent back one by one, but this is a wrong way and it does not work.


回答1:


You could store your messages in a database table. When a client is connected have messages delivered that are in the database. When the client has received through a function, have a response back to the HUB to do a function (mark the messages read or delete them from the table, etc...).

If a client gets disconnected, the messages are still in the table waiting to be delivered at next connection.

That is just an option. You need to determine what's best in your workflow.



来源:https://stackoverflow.com/questions/55897522/how-to-do-guaranteed-message-delivery-with-java-client-signalr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!