feat: add atomic batch publish engine & versioning support (Tasks 9-10)

- AtomicBatchPublishEngine: stage/commit/rollback semantics for batch publish
- JsVersioning: API level negotiation and stream/consumer metadata
- Fix NormalizeConfig missing AllowAtomicPublish, Metadata, PersistMode copy
- 46 batch publish tests + 67 versioning tests, all passing
This commit is contained in:
Joseph Doherty
2026-02-24 22:05:07 -05:00
parent cd009b9342
commit b80316a42f
10 changed files with 953 additions and 5 deletions

View File

@@ -4,4 +4,18 @@ public sealed class PublishOptions
{
public string? MsgId { get; init; }
public ulong ExpectedLastSeq { get; init; }
public ulong ExpectedLastSubjectSeq { get; init; }
public string? ExpectedLastSubjectSeqSubject { get; init; }
// Go: Nats-Batch-Id header — identifies which atomic batch this message belongs to.
public string? BatchId { get; init; }
// Go: Nats-Batch-Sequence header — 1-based position within the batch.
public ulong BatchSeq { get; init; }
// Go: Nats-Batch-Commit header — "1" or "eob" to commit, null/empty to stage only.
public string? BatchCommit { get; init; }
// Go: Nats-Expected-Last-Msg-Id header — unsupported inside a batch.
public string? ExpectedLastMsgId { get; init; }
}