feat: complete remaining jetstream parity implementation plan
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NATS.NKeys;
|
||||
using NATS.Server.Auth;
|
||||
@@ -805,6 +806,20 @@ public sealed class NatsServer : IMessageRouter, ISubListAccess, IDisposable
|
||||
public void ProcessMessage(string subject, string? replyTo, ReadOnlyMemory<byte> headers,
|
||||
ReadOnlyMemory<byte> payload, NatsClient sender)
|
||||
{
|
||||
if (replyTo != null
|
||||
&& subject.StartsWith("$JS.API", StringComparison.Ordinal)
|
||||
&& _jetStreamApiRouter != null)
|
||||
{
|
||||
var response = _jetStreamApiRouter.Route(subject, payload.Span);
|
||||
Interlocked.Increment(ref _stats.JetStreamApiTotal);
|
||||
if (response.Error != null)
|
||||
Interlocked.Increment(ref _stats.JetStreamApiErrors);
|
||||
|
||||
var data = JsonSerializer.SerializeToUtf8Bytes(response);
|
||||
ProcessMessage(replyTo, null, default, data, sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryCaptureJetStreamPublish(subject, payload, out var pubAck))
|
||||
sender.RecordJetStreamPubAck(pubAck);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user