feat(routes): add pool accounting per account and S2 compression codec (D2+D3)

D2: Add FNV-1a-based ComputeRoutePoolIdx to RouteManager matching Go's
route.go:533-545, with PoolIndex on RouteConnection and account-aware
ForwardRoutedMessageAsync that routes to the correct pool connection.

D3: Replace DeflateStream with IronSnappy in RouteCompressionCodec, add
RouteCompressionLevel enum, NegotiateCompression, and IsCompressed
detection. 17 new tests (6 pool + 11 compression), all passing.
This commit is contained in:
Joseph Doherty
2026-02-24 15:11:20 -05:00
parent 21d10582b3
commit 386cc201de
6 changed files with 479 additions and 19 deletions

View File

@@ -54,6 +54,12 @@ public sealed class NatsServer : IMessageRouter, ISubListAccess, IDisposable
private readonly TlsRateLimiter? _tlsRateLimiter;
private readonly SubjectTransform[] _subjectTransforms;
private readonly RouteManager? _routeManager;
/// <summary>
/// Exposes the route manager for testing. Internal — visible to test project
/// via InternalsVisibleTo.
/// </summary>
internal RouteManager? RouteManager => _routeManager;
private readonly GatewayManager? _gatewayManager;
private readonly LeafNodeManager? _leafNodeManager;
private readonly InternalClient? _jetStreamInternalClient;