Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Wrong JSON format of pub/sub message
May 25, 2021
9:15, EEST
Avatar
jelan
Member
Members
Forum Posts: 3
Member Since:
November 27, 2018
sp_UserOfflineSmall Offline

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

May 25, 2021
16:31, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi, thanks for the report. It seems that we don’t yet support the non-reversible encoding – is that what you are expecting or can you show the whole JSON message that you expected to see?

May 26, 2021
11:16, EEST
Avatar
jelan
Member
Members
Forum Posts: 3
Member Since:
November 27, 2018
sp_UserOfflineSmall Offline

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

May 26, 2021
15:34, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Ah, OK. Thanks for the details. Unfortunately, the fix didn’t quite make it to the 4.5.6 release of today, but if you send email to uajava-support at prosysopc dot com, we can provide you a new beta build that fixes the issue.

July 14, 2021
17:25, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1