View Issue Details

IDProjectCategoryView StatusLast Update
000630810000-014: PubSubSpecpublic2023-03-21 22:31
ReporterMartin Regen Assigned ToMatthias Damm  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.04 
Target Version1.05.03 RC1Fixed in Version1.05.03 RC1 
Summary0006308: Clarify how a JSON PubSub message is encoded
Description

Currently by looking at the spec it is not obvious how the output of a encoded JSON NetworkMessae/DataSetMessage should look like. There is risk many 'flavors' are invented to what should be a standard.

i) Specifically it is unclear how the 'FieldName' should be populated.
ii) Second the DataSetFieldContentMask is described in the following way:
• If the DataSetFieldContentMask results in a RawData representation, the field value is a Variant encoded using the non-reversible OPC UA JSON Data Encoding defined in OPC 10000-6.
• If the DataSetFieldContentMask results in a DataValue representation, the field value is a DataValue encoded using the non-reversible OPC UA JSON Data Encoding defined in OPC 10000-6.
• If the DataSetFieldContentMask results in a Variant representation, the field value is encoded as a Variant encoded using the reversible OPC UA JSON Data Encoding defined in OPC 10000-6.

Now adding to the confusing is some personal communication between Erich and Randy which revealed:
i) The Field Name should be the BrowseName. (This is a Qualified Name so it is unclear how to encode it as Key?)
ii) A DataValue should be encoded as reversible JSON. (This is exactly opposite to whats written in the spec above where a DataValue representation is encoded as a non-reversible)

Now looking at the MQTT prototype in the UA.-NET Standard repo there is also the DataValue encoded as reversible JSON.

Question: Is the spec correct ? Is the sample correct? Is the personal communication correct?

In fact, imho it would be preferred to follow the spec and publish the DataValue as non-reversible to reduce redundant information to be sent which is already in a meta data frame.
For the field name, it should be configurable to be very small, e.g. for each published node the key could be an alias to reduce data (NodeId 1 --> FieldName 'a', etc.)

Preferable would be a clarification or a sample in the spec.

Additional Information

https://github.com/Azure/iot-edge-opc-publisher#opc-publisher-telemetry-format

Here is a flavor which is currently produced by the publisher 2.7.199:

{
"MessageId": "18",
"MessageType": "ua-data",
"PublisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
"DataSetClassId": "78c4e91c-82cb-444e-a8e0-6bbacc9a946d",
"Messages": [
{
"DataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
"SequenceNumber": 18,
"MetaDataVersion": {
"MajorVersion": 1,
"MinorVersion": 1
},
"Timestamp": "2020-03-24T23:30:56.9597112Z",
"Status": null,
"Payload": {
"http://test.org/UA/Data/#i=10845": {
"Value": 99,
"SourceTimestamp": "2020-03-24T23:30:55.9891469Z",
"ServerTimestamp": "2020-03-24T23:30:55.9891469Z"
},
"http://test.org/UA/Data/#i=10846": {
"Value": 251,
"SourceTimestamp": "2020-03-24T23:30:55.9891469Z",
"ServerTimestamp": "2020-03-24T23:30:55.9891469Z"
}
}
}
]
}

TagsNo tags attached.
Commit Version
Fix Due Date

Relationships

related to 0007762 closedMatthias Damm Clarification for JSON DataSetMessage 
related to 0007425 closedMatthias Damm Restrictions for event JSON DataSetMessages 
related to 0007424 closedMatthias Damm PubSub JSON encoding for DataSetMessage needs reversible encoding for DataValue 
related to 0004505 assignedMatthias Damm Unclear encoding of integer PublisherId-s in JSON NetworkMessage 
related to 0007036 closedMatthias Damm Timestamp and Status in keep-alive JSON DataSetMessage not clearly specified 
related to 0008714 closedMatthias Damm JSON DataSetMessage needs option to include PublisherId in header 

Activities

Matthias Damm

2022-03-10 18:41

developer   ~0016316

We decided in the UA WG meeting this week to solve this issue with the definition of JSON Header Layouts including sample messages.

There is a proposal from the PubSub WG that needs to be integrated into Part 14

Zbynek Zahradnik

2022-03-11 07:08

developer   ~0016336

Note that the example here in "Additional Information" is invalid, due to this part:

"DataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
DataSetWriterId can only be UInt16.

I have encountered this kind of invalid DataSetWriterId many times in various interops, it probably comes from code base that is used in Azure but also elsewhere. I notified the developers but nobody seemed to care fixing it so far.

Matthias Damm

2023-02-26 20:56

developer   ~0018798

Added JSON header layout profiles and examples to clarify JSON message encoding and define default header settings.

  • Renamed Annex A from "UADP Header Layouts" to "Header Layouts" to be more generic
  • Moved all UADP definitions one level down to A.2 UADP Header Layouts
  • Added as new chapter A.3 JSON Header Layouts

Input was developed and reviewed by PubSub prototyping WG and MQTT WG.

Added in OPC 10000-14 - UA Specification Part 14 - PubSub 1.05.03 Draft1.docx

Jim Luth

2023-03-21 22:31

administrator   ~0018953

Agreed to changes edited in Dallas meeting.

Issue History

Date Modified Username Field Change
2020-12-09 14:35 Martin Regen New Issue
2021-09-14 17:14 Jim Luth Assigned To => Matthias Damm
2021-09-14 17:14 Jim Luth Status new => assigned
2022-03-10 18:41 Matthias Damm Severity minor => feature
2022-03-10 18:41 Matthias Damm Product Version => 1.04
2022-03-10 18:41 Matthias Damm Target Version => 1.05.02 RC1
2022-03-10 18:41 Matthias Damm Note Added: 0016316
2022-03-10 18:41 Matthias Damm Relationship added related to 0007762
2022-03-10 18:42 Matthias Damm Relationship added related to 0007425
2022-03-10 18:42 Matthias Damm Relationship added related to 0007424
2022-03-10 18:46 Matthias Damm Relationship added related to 0004505
2022-03-10 18:46 Matthias Damm Relationship added related to 0007036
2022-03-11 07:08 Zbynek Zahradnik Note Added: 0016336
2022-07-05 14:15 Jim Luth Target Version 1.05.02 RC1 => 1.05.03 RC1
2023-02-26 20:56 Matthias Damm Status assigned => resolved
2023-02-26 20:56 Matthias Damm Resolution open => fixed
2023-02-26 20:56 Matthias Damm Fixed in Version => 1.05.03 RC1
2023-02-26 20:56 Matthias Damm Note Added: 0018798
2023-02-26 21:05 Matthias Damm Relationship added related to 0008714
2023-03-21 22:31 Jim Luth Status resolved => closed
2023-03-21 22:31 Jim Luth Note Added: 0018953