Class CommandResponseMetadata
- Namespace
- Azure.Iot.Operations.Protocol.RPC
- Assembly
- Azure.Iot.Operations.Protocol.dll
public class CommandResponseMetadata
- Inheritance
-
CommandResponseMetadata
- Inherited Members
Constructors
CommandResponseMetadata()
Construct CommandResponseMetadata in user code, presumably within an execution function that will include the metadata in its return value.
public CommandResponseMetadata()
Remarks
- The CorrelationData field will be set to null; if the user-code execution function wants to know the correlation data, it should use the CommandRequestMetadata passed in by the CommandExecutor.
- The Status field will be set to null; the command status will not be determined until after execution completes.
- The StatusMessage field will be set to null; the command status will not be determined until after execution completes.
- The IsApplicationError field will be set to null; the command status will not be determined until after execution completes.
- The Timestamp field will be set to the current HybridLogicalClock time for the process.
- The UserData field will be initialized with an empty dictionary; entries in this dictionary can be set by user code as desired.
Properties
ContentType
The content type of a command response received by a command invoker if a content type was provided on the MQTT message.
public string? ContentType { get; }
Property Value
Remarks
This field is only set by the command invoker when deserializing a response. It cannot be used by a command executor to change the content type of a command response.
CorrelationId
The correlation data used to connect a command response to a command request. This property has no meaning to a user-code execution function on the CommandExecutor; the CorrelationData is set to null on construction. When CommandResponseMetadata is returned by command invocation on the CommandInvoker, the CorrelationData is set from the response message.
public Guid? CorrelationId { get; }
Property Value
- Guid?
PayloadFormatIndicator
The payload format indicator of a command response received by a command invoker.
public MqttPayloadFormatIndicator PayloadFormatIndicator { get; }
Property Value
Remarks
This field is only set by the command invoker when deserializing a response. It cannot be used by a command executor to change the payload format indicator of a command response.
Timestamp
The timestamp attached to the response. When CommandResponseMetadata is constructed within a user-code execution function on the CommandExecutor, the Timestamp is set from the HybridLogicalClock of the CommandExecutor. When CommandResponseMetadata is returned by command invocation on the CommandInvoker, the Timestamp is set from the response message; this will be null if the message contains no timestamp header.
public HybridLogicalClock? Timestamp { get; }
Property Value
UserData
A dictionary of user properties that are sent along with the response from the CommandExecutor to the CommandInvoker. When CommandResponseMetadata is constructed within a user-code execution function on the CommandExecutor, the UserData is initialized with an empty dictionary. When CommandResponseMetadata is returned by command invocation on the CommandInvoker, the UserData is set from the response message.
public Dictionary<string, string> UserData { get; set; }
Property Value
Methods
MarshalTo(MqttApplicationMessage)
public void MarshalTo(MqttApplicationMessage message)
Parameters
message
MqttApplicationMessage