Buffering Messages During Reconnect Attempts
// Set reconnect buffer size in bytes (5 MB)
nc, err := nats.Connect("demo.nats.io", nats.ReconnectBufSize(5*1024*1024))
if err != nil {
log.Fatal(err)
}
defer nc.Close()
// Do something with the connectionOptions options = new Options.Builder()
.server("nats://demo.nats.io:4222")
.reconnectBufferSize(5 * 1024 * 1024) // Set buffer in bytes
.build();
Connection nc = Nats.connect(options);
// Do something with the connection
nc.close();// Reconnect buffer size is not configurable on NATS JavaScript client# Asyncio NATS client currently does not implement a reconnect buffer// Reconnect buffer size is not configurable on NATS .NET client# There is currently no reconnect pending buffer as part of the Ruby NATS clientLast updated
Was this helpful?