

9:15, EEST

November 27, 2018

Hi,
We have a 4.5.2-1405 version of the Java SDK, and tested the sample code of the Pub/Sub. We found the JSON format of pub/sub is wrong as below.
{“MessageId”:”abf2ae8d-7cc5-4901-b172-4dc18233cc42″,”MessageType”:”ua-data”,”Messages”:[{“DataSetWriterId”:”2″,”Timestamp”:”2021-05-25T12:05:15+0800″,”Payload”:[“Voltage”:{“Value”:{“Type”:11,”Body”:227.0},”SourceTimestamp”:”2021-05-25T12:04:54+0800″}]}]}
The Payload content is in the wrong format.
Please help, thanks.
Best regards,
jelan
16:31, EEST

December 21, 2011

11:16, EEST

November 27, 2018

Hi,
We except the Payload value should be a JSON object, not a JSON array.
SDK generated:
{“MessageId”:”abf2ae8d-7cc5-4901-b172-4dc18233cc42″,”MessageType”:”ua-data”,”Messages”:[{“DataSetWriterId”:”2″,”Timestamp”:”2021-05- 25T12:05:15+0800″,”Payload”:[“Voltage”:{“Value”:{“Type”:11,”Body”:227.0},”SourceTimestamp”:”2021-05-25T12:04:54+0800″}]}]} ^ this [ should be { ^ this ] should be }
We expect:
{“MessageId”:”abf2ae8d-7cc5-4901-b172-4dc18233cc42″,”MessageType”:”ua-data”,”Messages”:[{“DataSetWriterId”:”2″,”Timestamp”:”2021-05-25T12:05:15+0800″,”Payload”:{“Voltage”:{“Value”:{“Type”:11,”Body”:227.0},”SourceTimestamp”:”2021-05-25T12:04:54+0800″}}}]}
BR,
jelan
15:34, EEST

December 21, 2011

17:25, EEST

December 21, 2011

This has now been fixed in release 4.5.8, along with a few other MQTT and JSON related improvements, so please make sure you have the latest version.
1 Guest(s)
