One of the use cases for PubSub is the publication of data to IT applications through a topic or message queue where the IT application does not have any knowledge about OPC UA. In such a use case, the messages that are sent to the message queue can only contain one DataSetMessage and there should be no OPC UA specific information or header.
The header layout described in this section is optimized for this use case.
A minimal message has the following settings:
- Each NetworkMessage contains one DataSetMessage
- The NetworkMessage header is not included
- The DataSetMessage header is not included
- The DataSet field encoding can be configured
The header layout URI for the mimimal layout as specified in A.3.2.4 is
http://opcfoundation.org/UA/PubSub-Layouts/JSON-Minimal
Table A.16 defines the values for the WriterGroup configuration parameters representing this layout.
Table A.16 – Values for WriterGroup configuration parameters
Parameter |
Value |
JsonNetworkMessageContentMask |
0x00000004
This value results of the following options: Bit 0: NetworkMessageHeader = 0 Bit 1: DataSetMessageHeader = 0 Bit 2: SingleDataSetMessage = 1 Bit 3: PublisherId = 0 Bit 4: DataSetClassId = 0 Bit 5: ReplyTo = 0 Bit 6: WriterGroupName = 0 |
Table A.17 defines the values for the DataSetWriter configuration parameters representing this layout.
Table A.17 – Values for DataSetWriter configuration parameters
Parameter |
Value |
JsonDataSetMessageContentMask |
0x0
This value results of the following options: Bit 0: DataSetWriterId = 0 Bit 1: MetaDataVersion = 0 Bit 2: SequenceNumber = 0 Bit 3: Timestamp = 0 Bit 4: Status = 0 Bit 5: MessageType = 0 Bit 6: DataSetWriterName = 0 Bit 7: ReversibleFieldEncoding = 0 Bit 8: PublisherId = 0 Bit 9: WriterGroupName = 0 Bit 10: MinorVersion = 0 |
DataSetFieldContentMask |
0 |
KeyFrameCount |
configurable |
Example for DataSet1.
{
"Active":true,
"Temperature":25.5,
"Counter":0,
"AdditionalInfo":"The system is running normally (1)"
}
Example for DataSet2.
{
"LocationName":"Building A",
"Coordinate":
{
"X":0,
"Y":0.2
},
"Measurements":
[
20030,
20020,
20010
]
}
Example for DataSet3.
{
"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":"Localized text 1",
"ByteStringValue":"AAEC",
"NodeIdValue":
{
"IdType":1,
"Id":"Boilers.Boiler #1.PipeX001.ValveX001.Input",
"Namespace":"http://test.org/UA/Data/Instance"
},
"QualifiedNameValue":
{
"Name":"PipeX001",
"Uri":"http://test.org/UA/Data/"
}
}