如何在MQTT经纪人Mosquitto中显示已交付和已阅读的收据? [英] How to display delivered and read receipts in MQTT broker Mosquitto?

查看:101
本文介绍了如何在MQTT经纪人Mosquitto中显示已交付和已阅读的收据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的消息传递平台中向用户显示已发送和已阅读的回执.我使用的是Mosquitto作为代理的Eclipse的Paho库.由于Mosquitto不存储消息,因此这是

I want to display delivered and read receipts to users in my messaging platform. I am using Eclipse's Paho library with Mosquitto as the broker. Since Mosquitto does not store messages, which is the best way/plugin to

  1. 显示已交付的收据-如何使用QoS2确认收据来做到这一点?
  2. 显示已读回执-向我建议这样做的方法
  3. 如何存储消息,以便用户可以查看其聊天记录? mysql中的任何体系结构见解都将非常有帮助.
  1. Display delivered receipts - how to use QoS2 acknowledgement receipts to do this?
  2. Display read receipts - suggest me way to do this
  3. How to store messages so that users can view their chat history? Any architectural insights in mysql will be very helpful.

推荐答案

您的问题的快速答案:

  1. 高QOS(1/2)并不是端到端的交付确认,它只是经纪人和客户之间的确认.例如在QOS 2上进行发布的发布者,确认仅在发布者和代理之间进行,而不是在订阅者(无论如何都可以在不同的QOS进行订阅)上进行.唯一的方法是将一条单独的消息从接收端发送回发送方.同样,给定主题的订阅者可能不止一个,因此您必须考虑这将如何工作.

  1. High QOS (1/2) is not end to end delivery confirmation, it is only confirmation between the broker and a client. e.g. a publisher publishing at QOS 2 the confirmation is only between the publisher and the broker, not then onward to the subscriber (who may be subscribed at a different QOS anyway). The only way to do this is to send a separate message from the receiving end back to the sender. Also there may be more than one subscriber to any given topic, so you have to think how this would work.

同样,唯一的方法是在阅读邮件时发送一条单独的邮件

Again, the only way to do this is with a separate message sent when the message is read

您将必须自己实现.唯一可能有用的是类似于内置支持,用于将消息存储在某些代理中存在的数据库中(这不是规范的一部分,因此完全有利于实现). hivemq

You will have to implement this yourself. The only thing that may help is something like the built in support for storing messages in a database present in some brokers (this is not part of the spec, so totally propitiatory to the implementation) e.g. hivemq

这篇关于如何在MQTT经纪人Mosquitto中显示已交付和已阅读的收据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆