In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What is the actual situation of synchronous RRPC calls based on Pub/Sub? in order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
1. Synchronous call scenario 1.1 background
MQTT protocol is an asynchronous communication mode based on PUB/SUB, which can not realize the scenario in which the server sends instructions to the device and the device returns the response result.
IoT Internet of things platform establishes a set of synchronization mechanism of request and response based on MQTT protocol, which can realize synchronous communication without changing MQTT protocol. The application server initiates the RRPC call through POP API, and the IoT device only needs to reply to the Pub message in the Timeout according to the fixed format, and the server can synchronously obtain the response result of the IoT device.
The specific process is as follows:
1.2 Topic format convention
two。 Synchronous call to RRPC sample 2.1 device-side code
2.2 POP calls Rrpc on the server
Rrpc response:
3. Object Model-Service synchronous invocation InvokeThingService example
Note: the object model service invokes the POP interface
It's InvokeThingService, not RRPC.
3.1 object Model-synchronization Service definition
3.2 device-side implementation
Note: the payload of the device side response should satisfy the output structure defined by the object model.
3.3object model-service invocation POP interface InvokeThingService
The result of the service call is returned:
The answer to the question about the actual combat of synchronous RRPC calls based on Pub/Sub is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.