Response handling in MQTT

4 posts / 0 new
Last post
Bhaumik
Response handling in MQTT

Hi Mikko,

Currently, I am testing IS15959-2 meter.
We are sending multiple requests to the multiple meters by calling middleware service. The service is sending request payload torespective to meters.

And all meters will send a response on MQTT.
For that, we have created a single MQTT client and multiple subscribers.

Now the case if we sending SNRM requests to multiple meters, all responses will be received on subscribed events. In that case how to handle all responses using a single MQTT client.

If multiple MQTT clients and its subscriber event used then we are able to handle responses for device wise.
For the above-described scenario how to handle responses?

If more data available then how to send the next frame/block request and merge response?

Can you please provide your feedback on this.

Kurumi
Kurumi's picture

Hi,

You need to send the MQTT request to the one-meter at the time. You need to define a target meter using meter's serial number, etc to MQTT topic.

If you send MQTT messages like broadcast, all the meters will reply and it's not right.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

Bhaumik

Hi Mikko,

I am sending a request to the meter by calling API. API will transfer messages to the respective meter. And respective meter sends a response on MQTT.

I am doing this process for multiple meters using Thread. Like for 10 meters, a separate thread will call to API. And at MQTT subscriber all meter's response will be received. In that case how to handle the response.

Kurumi
Kurumi's picture

Hi,

If you are using serial number as server address this is possible if the meter supports it.
Otherwise, you can't do it like this. There is no way to detected the sender from the message bytes.

You must handle it mapping the meter and MQTT request somehow.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi