MQTT-SN v1.2 能否支持 MQTT v5 支持的请求-响应模式?
Can MQTT-SN v1.2 support the request-response pattern that is supported by MQTT v5?
我阅读了 MQTT-SN 规范,不确定它是否也支持请求-响应模式。有人知道吗?
正在尝试实现类似这样的东西...
http://www.steves-internet-guide.com/mqttv5-request-response/
MQTT v5 发布命令可以指定响应主题,如此处的 MQTT v5 规范所示:
https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
4.10.1 Basic Request Response (non-normative)
Request/Response interaction proceeds as follows:
An MQTT Client (the Requester) publishes a Request Message to a topic. A Request Message is an >Application Message with a Response Topic.
Another MQTT Client (the Responder) has subscribed to a Topic Filter which matches the Topic Name >used when the Request Message was published. As a result, it receives the Request Message. There could >be multiple Responders subscribed to this Topic Name or there could be none.
The Responder takes the appropriate action based on the Request Message, and then publishes a >Response Message to the Topic Name in the Response Topic property that was carried in the Request >Message.
In typical usage the Requester has subscribed to the Response Topic and thereby receives the >Response Message. However, some other Client might be subscribed to the Response Topic in which case the >Response Message will also be received and processed by that Client. As with the Request Message, the >topic on which the Response Message is sent could be subscribed to by multiple Clients, or by none.
MQTT-SN 规范在这里
http://mqtt.org/new/wp-content/uploads/2009/06/MQTT-SN_spec_v1.2.pdf
只是写法不同,我不知道是否支持此功能。
最终,对于某些消息,我需要有一个不能留给 pub/sub 即发即弃模式的响应。连接需要 MQTT-SN v1.2,因为它通过 BLE 并且不支持 TCP/IP,因此没有常规 MQTT v5.
我想我可以组成一个 "Response Topic" 字段以放入接收客户端可以处理和响应的请求的有效负载中。但是,MQTT-SN v1.2 规范是否已经支持它?
否,MQTT-SN v1.2 不包含 v5 中添加到 MQTT 的功能。
正如您所说,没有什么可以阻止您在消息负载中包含您自己的响应主题字段。
我阅读了 MQTT-SN 规范,不确定它是否也支持请求-响应模式。有人知道吗?
正在尝试实现类似这样的东西... http://www.steves-internet-guide.com/mqttv5-request-response/
MQTT v5 发布命令可以指定响应主题,如此处的 MQTT v5 规范所示: https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
4.10.1 Basic Request Response (non-normative) Request/Response interaction proceeds as follows:
An MQTT Client (the Requester) publishes a Request Message to a topic. A Request Message is an >Application Message with a Response Topic.
Another MQTT Client (the Responder) has subscribed to a Topic Filter which matches the Topic Name >used when the Request Message was published. As a result, it receives the Request Message. There could >be multiple Responders subscribed to this Topic Name or there could be none.
The Responder takes the appropriate action based on the Request Message, and then publishes a >Response Message to the Topic Name in the Response Topic property that was carried in the Request >Message.
In typical usage the Requester has subscribed to the Response Topic and thereby receives the >Response Message. However, some other Client might be subscribed to the Response Topic in which case the >Response Message will also be received and processed by that Client. As with the Request Message, the >topic on which the Response Message is sent could be subscribed to by multiple Clients, or by none.
MQTT-SN 规范在这里 http://mqtt.org/new/wp-content/uploads/2009/06/MQTT-SN_spec_v1.2.pdf
只是写法不同,我不知道是否支持此功能。
最终,对于某些消息,我需要有一个不能留给 pub/sub 即发即弃模式的响应。连接需要 MQTT-SN v1.2,因为它通过 BLE 并且不支持 TCP/IP,因此没有常规 MQTT v5.
我想我可以组成一个 "Response Topic" 字段以放入接收客户端可以处理和响应的请求的有效负载中。但是,MQTT-SN v1.2 规范是否已经支持它?
否,MQTT-SN v1.2 不包含 v5 中添加到 MQTT 的功能。
正如您所说,没有什么可以阻止您在消息负载中包含您自己的响应主题字段。