This captures the iterative CommentChecker cleanup plus updated snapshot/report outputs used to validate and benchmark the latest JetStream and transport work.
116 lines
4.2 KiB
C#
116 lines
4.2 KiB
C#
namespace NATS.Server.Mqtt;
|
|
|
|
/// <summary>
|
|
/// JetStream API helper context for MQTT account/session operations.
|
|
/// Go reference: mqtt.go mqttJSA.
|
|
/// </summary>
|
|
public sealed class MqttJsa
|
|
{
|
|
/// <summary>Account that owns the MQTT JetStream operations.</summary>
|
|
public string AccountName { get; set; } = string.Empty;
|
|
/// <summary>Reply subject prefix used for MQTT JetStream API calls.</summary>
|
|
public string ReplyPrefix { get; set; } = string.Empty;
|
|
/// <summary>Optional JetStream domain for cross-domain routing.</summary>
|
|
public string? Domain { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// MQTT JetStream publish request shape.
|
|
/// Go reference: mqtt.go mqttJSPubMsg.
|
|
/// </summary>
|
|
public sealed class MqttJsPubMsg
|
|
{
|
|
/// <summary>Target NATS subject for the publish operation.</summary>
|
|
public string Subject { get; set; } = string.Empty;
|
|
/// <summary>Published payload bytes.</summary>
|
|
public byte[] Payload { get; set; } = [];
|
|
/// <summary>Optional reply subject for request/reply semantics.</summary>
|
|
public string? ReplyTo { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retained-message delete notification payload.
|
|
/// Go reference: mqtt.go mqttRetMsgDel.
|
|
/// </summary>
|
|
public sealed class MqttRetMsgDel
|
|
{
|
|
/// <summary>MQTT topic whose retained message should be removed.</summary>
|
|
public string Topic { get; set; } = string.Empty;
|
|
/// <summary>JetStream sequence of the retained message record.</summary>
|
|
public ulong Sequence { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Persisted MQTT session metadata.
|
|
/// Go reference: mqtt.go mqttPersistedSession.
|
|
/// </summary>
|
|
public sealed class MqttPersistedSession
|
|
{
|
|
/// <summary>MQTT client identifier for the persisted session.</summary>
|
|
public string ClientId { get; set; } = string.Empty;
|
|
/// <summary>Last issued packet identifier for this session.</summary>
|
|
public int LastPacketId { get; set; }
|
|
/// <summary>Maximum number of unacknowledged QoS deliveries allowed.</summary>
|
|
public int MaxAckPending { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Reference to a retained message in storage.
|
|
/// Go reference: mqtt.go mqttRetainedMsgRef.
|
|
/// </summary>
|
|
public sealed class MqttRetainedMessageRef
|
|
{
|
|
/// <summary>JetStream sequence containing the retained MQTT payload.</summary>
|
|
public ulong StreamSequence { get; set; }
|
|
/// <summary>NATS subject mapped from the retained MQTT topic.</summary>
|
|
public string Subject { get; set; } = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// MQTT subscription metadata.
|
|
/// Go reference: mqtt.go mqttSub.
|
|
/// </summary>
|
|
public sealed class MqttSub
|
|
{
|
|
/// <summary>MQTT topic filter for this subscription.</summary>
|
|
public string Filter { get; set; } = string.Empty;
|
|
/// <summary>Requested MQTT QoS level.</summary>
|
|
public byte Qos { get; set; }
|
|
/// <summary>Optional JetStream durable consumer name.</summary>
|
|
public string? JsDur { get; set; }
|
|
/// <summary>Indicates whether this is a permanent subscription.</summary>
|
|
public bool Prm { get; set; }
|
|
/// <summary>Reserved flag kept for Go protocol parity.</summary>
|
|
public bool Reserved { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Parsed MQTT filter metadata.
|
|
/// Go reference: mqtt.go mqttFilter.
|
|
/// </summary>
|
|
public sealed class MqttFilter
|
|
{
|
|
/// <summary>Original MQTT topic filter.</summary>
|
|
public string Filter { get; set; } = string.Empty;
|
|
/// <summary>QoS level attached to the filter.</summary>
|
|
public byte Qos { get; set; }
|
|
/// <summary>Parsed token optimization hint used for dispatch lookups.</summary>
|
|
public string? TopicToken { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Parsed NATS headers associated with an MQTT publish flow.
|
|
/// Go reference: mqtt.go mqttParsedPublishNATSHeader.
|
|
/// </summary>
|
|
public sealed class MqttParsedPublishNatsHeader
|
|
{
|
|
/// <summary>Subject extracted from MQTT publish headers, when present.</summary>
|
|
public string? Subject { get; set; }
|
|
/// <summary>Mapped subject after account/topic translation.</summary>
|
|
public string? Mapped { get; set; }
|
|
/// <summary>Indicates the packet represents a PUBLISH flow.</summary>
|
|
public bool IsPublish { get; set; }
|
|
/// <summary>Indicates the packet represents a PUBREL flow.</summary>
|
|
public bool IsPubRel { get; set; }
|
|
}
|