One of the use cases is streaming of multiple different data and event DataSets through a single message queue for further processing in cloud applications.
Another use case is the execution of Actions.
The header layout described in this section is optimized for this use case.
In general this header layout is the most flexible option and should be used if only one header layout is preferred.
A minimal message has the following settings:
- Each NetworkMessage contains an array of DataSetMessages
- The NetworkMessage header is included, the header fields can be configured
- The DataSetMessage header is included, the header fields can be configured
- The DataSet field encoding can be configured
The header layout URI for the multiple DataSetMessages layout as specified in A.3.4.4 is
http://opcfoundation.org/UA/PubSub-Layouts/JSON-NetworkMessage
Table A.20 defines the values for the WriterGroup configuration parameters representing this layout.
Table A.20 – Values for WriterGroup configuration parameters
Parameter |
Value |
JsonNetworkMessageContentMask |
The mask allows the following options: Bit 0: NetworkMessageHeader = 1 Bit 1: DataSetMessageHeader = 1 Bit 2: SingleDataSetMessage = 0 Bit 3: PublisherId = 1 Bit 4: DataSetClassId configurable (default is 0) Bit 5: ReplyTo configurable (default is 0) Bit 6: WriterGroupName configurable (default is 0) |
Table A.21 defines the values for the DataSetWriter configuration parameters representing this layout.
Table A.21 – Values for DataSetWriter configuration parameters
Parameter |
Value |
JsonDataSetMessageContentMask |
The mask allows the following options: Bit 0: DataSetWriterId = 1 Bit 1: MetaDataVersion = 0 Bit 2: SequenceNumber = 1 The SequenceNumber is always omitted for Action messages. Bit 3: Timestamp = 1 Bit 4: Status = 1 The Status is omitted for ActionRequest messages. Bit 5: MessageType configurable (default is 0) Bit 6: DataSetWriterName configurable (default is 0) Bit 7: FieldEncoding1 = 0 Bit 8: PublisherId = 0 Bit 9: WriterGroupName configurable (default is 0) Bit 10: MinorVersion = 1 Bit 11: FieldEncoding2 = 1 |
DataSetFieldContentMask |
Configurable (default is 0) The value shall be 0 or 0x20 if the KeyFrameCount is 0. |
KeyFrameCount |
Configurable If the KeyFrameCount is not 1, the MessageType bit shall be true. |
Example for DataSet1, DataSet2 and DataSet3 with all configurable JsonNetworkMessageContentMask and JsonDataSetMessageContentMask flags set to false and no flags set for DataSetFieldContentMask.
{
"MessageId":"9279c0b3-da88-45a4-af74-451cebf82db0",
"MessageType":"ua-data",
"PublisherId":"MyPublisher",
"Messages":
[
{
"DataSetWriterId":101,
"SequenceNumber":68468,
"MinorVersion":672341762,
"Timestamp":"2021-09-27T18:45:19.555Z",
"Payload":
{
"Active":true,
"Temperature":25.5,
"Counter":0,
"AdditionalInfo":"The system is running normally (1)"
}
},
{
"DataSetWriterId":102,
"SequenceNumber":25460,
"MinorVersion":672341762,
"Timestamp":"2021-09-27T18:45:19.555Z",
"Status":1073741824,
"Payload":
{
"LocationName":"Building A",
"Coordinate":{"X":0,"Y":0.2},
"Measurements":[20030,20020,20010]
}
},
{
"DataSetWriterId":103,
"SequenceNumber":66915,
"MinorVersion":672341762,
"Timestamp":"2021-09-27T18:45:19.555Z",
"Payload":
{
"BooleanValue":false,
"Int32Value":0,
"Int64Value":"1",
"UInt32Value":1,
"UInt64Value":"1",
"DoubleValue":0.5,
"DateTimeValue":"2021-09-14T07:14:30Z",
"StringValue":"String 1",
"GuidValue":"ebfc352a-3142-4b99-9bbe-89a517d6a77e",
"StatusCodeValue":
{
"Code":2147483648,
"Symbol":"Bad"
},
"LocalizedTextValue":
{
"Locale":"en"
"Text":"Localized text 1"
},
"ByteStringValue":"AAEC",
"NodeIdValue":"nsu=http://test.org/UA/Data/Instance;s=Pipe001.Valve001.Input",
"QualifiedNameValue":"nsu=http://test.org/UA/Data/;PipeX001"
}
}
]
}