The AMQP message header has a number of standard fields which are called properties in the AMQP specification. Table B.1 describes how these fields are populated when an AMQP message is constructed.
Table B.1 – AMQP standard header fields
|
Field Name |
Source |
|
message-id |
A globally unique value per message. |
|
Subject |
Valid values are ua-data or ua-metadata. |
|
Content-type |
The MIME type for the message body. The MIME types are specified in the message body subclauses B.3.8.1 and B.3.8.3. |
The subject defines the type of the message contained in the AMQP body. A value of “ua-data” specifies the body contains a UADP or JSON NetworkMessage. A value of “ua-metadata” specifies a body that contains a UA Binary or JSON encoded DataSetMetaData Message. The content-type specifies the whether the message is binary or JSON data.
The AMQP message header includes additional fields defined on the WriterGroup or DataSetWriter through the KeyValuePair array in the WriterGroupProperties and DataSetWriterProperties. The NamespaceIndex of the QualifiedName in the KeyValuePair is 0 for AMQP standard message properties. The Name of the QualifiedName is constructed from a message prefix and the AMQP property name with the following syntax.
Name = message-<AMQP property name>
Table B.2 defines the AMQP standard message properties.
Table B.2 – OPC UA AMQP standard header QualifiedName Name mappings
|
AMQP standard property name |
OPC UA DataType |
AMQP data type |
Note |
|
To |
String |
* |
|
|
user-id |
ByteString |
binary |
|
|
reply-to |
String |
string |
|
|
correlation-id |
ByteString |
* |
|
|
absolute-expiry-time |
Duration |
timestamp |
The absolute-expiry-time is calculated by adding the message-absolute-expiry-time (Duration) from the DataSetWriterProperties to the current time of the DataSetMessage creation. |
|
Group-id |
String |
string |
|
|
reply-to-group-id |
String |
string |
|
|
creation-time |
Boolean |
timestamp |
The creation-time is set to the current time of the DataSetMessage creation if the message-creation-time (Boolean) in the DataSetWriterProperties is True, or else if the value is False or if the property is not configured, the AMQP property is not set. |
|
Content-encoding |
String |
symbol |
|
Any name not in the table is assumed to be an application property. In this case the namespace provided as part of the QualifiedName is the ApplicationUri.
The AMQP message header includes additional promoted fields of the DataSet as a list of name-value pairs. DataSet fields with the PromotedField flag set in the FieldMetaData fieldFlags are copied into the AMQP header. The FieldMetaData Structure is defined in 6.2.3.2.4. Promoted fields are always included in the header even if the DataSetMessage body is a delta frame and the DataSet field is not included in the delta frame. In this case the last known value is sent in the header.
When a field is added to the header it is converted to an AMQP data type using the rules defined in Table B.3. If there is no rule defined for the data type, the field are not included.
Table B.3 – OPC UA AMQP header field conversion rules
|
OPC UA DataType |
Conversion Rules to AMQP data types. |
|
Boolean |
AMQP ‘boolean’ type. |
|
Sbyte |
AMQP ‘byte’ type. |
|
Byte |
AMQP ‘ubyte’ type. |
|
Int16 |
AMQP ‘short’ type. |
|
UInt16 |
AMQP ‘ushort’ type. |
|
Int32 |
AMQP ‘int’ type. |
|
UInt32 |
AMQP ‘uint’ type. |
|
Int64 |
AMQP ‘long’ type. |
|
UInt64 |
AMQP ‘ulong’ type. |
|
Float |
AMQP ‘float’ type. |
|
Double |
AMQP ‘double’ type. |
|
String |
AMQP ‘string’ type. |
|
ByteString |
AMQP ‘binary’ type. |
|
DateTime |
AMQP ‘timestamp’ type. This conversion may result in loss of precision on some platforms. The rules for dealing with the loss of precision are described in OPC 10000-6. |
|
Guid |
AMQP ‘uuid’ type. |
|
QualifiedName |
The QualifiedName is encoded as an AMQP ‘string’ type using the QualifiedName String encoding defined in OPC 10000-6. |
|
LocalizedText |
Not supported and the related field is discarded. |
|
NodeId |
If the NamespaceIndex = 0 the value is encoded as an AMQP ‘string’ type using the format for a NodeId defined in OPC 10000-6. If the NamespaceIndex > 0 the value is converted to an ExpandedNodeId with a NamespaceUri and is encoded as an AMQP ‘string’ type using the format for an ExpandedNodeId defined in OPC 10000-6. |
|
ExpandedNodeId |
If the NamespaceUri is not provided the rules for the NodeId are used. If the NamespaceUri is provided the value is encoded as an AMQP ‘string’ type using the format for an ExpandedNodeId defined in OPC 10000-6. |
|
StatusCode |
AMQP ‘uint’ type. |
|
Variant |
If the value has a supported datatype it uses that conversion; otherwise it is not supported and the related field is discarded. |
|
Structure |
Not supported and the related field is discarded. |
|
Structure with option fields |
Not supported and the related field is discarded. |
|
Array |
Not supported and the related field is discarded. |
|
Union |
Not supported and the related field is discarded. |