feat(batch27): implement jetstream config validation and error tail

This commit is contained in:
Joseph Doherty
2026-02-28 21:15:57 -05:00
parent 68f32c7b85
commit 5b2d32c503
6 changed files with 214 additions and 0 deletions

View File

@@ -111,6 +111,22 @@ public sealed partial class Account
return EnableAllJetStreamServiceImportsAndMappings();
}
internal (NatsServer? Server, JsAccount? JetStreamAccount, Exception? Error) CheckForJetStream()
{
_mu.EnterReadLock();
var server = Server as NatsServer;
var jsa = JetStream;
_mu.ExitReadLock();
if (server == null || jsa == null)
{
var description = JsApiErrors.NewJSNotEnabledForAccountError().Description ?? "jetstream not enabled for account";
return (null, null, new InvalidOperationException(description));
}
return (server, jsa, null);
}
internal (bool MaxBytesRequired, long MaxStreamBytes) MaxBytesLimits(StreamConfig? cfg)
{
_mu.EnterReadLock();