Use golang language to subsribe mqtt service, but playload message is like picture that. no json format. how to decode payload content body?
By default, integrations are in protobuf format, and use the definitions located in the ‘/api’ directory of the ChirpStack repo. Since you’re working in Go, I would recommend sticking with protobuff for performance and strong typing, over flipping it to JSON.
Please note that this configuration is for the
application/..... topics. The data you are looking at is for the gateway topics. You might want to subscribe to
application/# to make sure you are reading the correct data.
Thank you for response！When I try to parse the payload data, I encounter an error, ‘cannot parse invalid wire-format data.’ How can I handle this issue? Thanks again.
Not every payload that comes off the application topic (top-level) will be an uplink event. You haven’t posted the code that you used to subscribe to a topic, so we don’t know. See also:
I apologize for the interruption again. After obtaining the payload through MQTT on my end, I attempted to decode it directly using Protocol Buffers (proto). However, I encountered an error as shown in the screenshot. Thank you!