Fix E2E test gaps and add comprehensive E2E + parity test suites
- Fix pull consumer fetch: send original stream subject in HMSG (not inbox) so NATS client distinguishes data messages from control messages - Fix MaxAge expiry: add background timer in StreamManager for periodic pruning - Fix JetStream wire format: Go-compatible anonymous objects with string enums, proper offset-based pagination for stream/consumer list APIs - Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream) - Add ~1000 parity tests across all subsystems (gaps closure) - Update gap inventory docs to reflect implementation status
This commit is contained in:
90
src/NATS.Server/Mqtt/MqttParityModels.cs
Normal file
90
src/NATS.Server/Mqtt/MqttParityModels.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace NATS.Server.Mqtt;
|
||||
|
||||
/// <summary>
|
||||
/// JetStream API helper context for MQTT account/session operations.
|
||||
/// Go reference: mqtt.go mqttJSA.
|
||||
/// </summary>
|
||||
public sealed class MqttJsa
|
||||
{
|
||||
public string AccountName { get; set; } = string.Empty;
|
||||
public string ReplyPrefix { get; set; } = string.Empty;
|
||||
public string? Domain { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MQTT JetStream publish request shape.
|
||||
/// Go reference: mqtt.go mqttJSPubMsg.
|
||||
/// </summary>
|
||||
public sealed class MqttJsPubMsg
|
||||
{
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
public byte[] Payload { get; set; } = [];
|
||||
public string? ReplyTo { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retained-message delete notification payload.
|
||||
/// Go reference: mqtt.go mqttRetMsgDel.
|
||||
/// </summary>
|
||||
public sealed class MqttRetMsgDel
|
||||
{
|
||||
public string Topic { get; set; } = string.Empty;
|
||||
public ulong Sequence { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Persisted MQTT session metadata.
|
||||
/// Go reference: mqtt.go mqttPersistedSession.
|
||||
/// </summary>
|
||||
public sealed class MqttPersistedSession
|
||||
{
|
||||
public string ClientId { get; set; } = string.Empty;
|
||||
public int LastPacketId { get; set; }
|
||||
public int MaxAckPending { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reference to a retained message in storage.
|
||||
/// Go reference: mqtt.go mqttRetainedMsgRef.
|
||||
/// </summary>
|
||||
public sealed class MqttRetainedMessageRef
|
||||
{
|
||||
public ulong StreamSequence { get; set; }
|
||||
public string Subject { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MQTT subscription metadata.
|
||||
/// Go reference: mqtt.go mqttSub.
|
||||
/// </summary>
|
||||
public sealed class MqttSub
|
||||
{
|
||||
public string Filter { get; set; } = string.Empty;
|
||||
public byte Qos { get; set; }
|
||||
public string? JsDur { get; set; }
|
||||
public bool Prm { get; set; }
|
||||
public bool Reserved { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parsed MQTT filter metadata.
|
||||
/// Go reference: mqtt.go mqttFilter.
|
||||
/// </summary>
|
||||
public sealed class MqttFilter
|
||||
{
|
||||
public string Filter { get; set; } = string.Empty;
|
||||
public byte Qos { get; set; }
|
||||
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
|
||||
{
|
||||
public string? Subject { get; set; }
|
||||
public string? Mapped { get; set; }
|
||||
public bool IsPublish { get; set; }
|
||||
public bool IsPubRel { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user