diff --git a/developing-with-nats/intro-1/buffer.md b/developing-with-nats/intro-1/buffer.md index 62b460a..9ec526f 100644 --- a/developing-with-nats/intro-1/buffer.md +++ b/developing-with-nats/intro-1/buffer.md @@ -8,7 +8,59 @@ Be aware, while the message appears to be sent to the application it is possible For clients that support this feature, you are able to configure the size of this buffer with bytes, messages or both. -!INCLUDE "../../\_examples/reconnect\_5mb.html" +{% tabs %} +{% tab title="Go" %} +```go +// 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 connection +``` +{% endtab %} + +{% tab title="Java" %} +```java +Options 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(); +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +// Reconnect buffer size is not configurable on NATS Javascript client +``` +{% endtab %} + +{% tab title="Python" %} +```python +# Asyncio NATS client currently does not implement a reconnect buffer +``` +{% endtab %} + +{% tab title="Ruby" %} +```ruby +# There is currently no reconnect pending buffer as part of the Ruby NATS client +``` +{% endtab %} + +{% tab title="TypeScript" %} +```typescript +// Reconnect buffer size is not configurable on NATS Typescript client + +``` +{% endtab %} +{% endtabs %} > _As mentioned throughout this document, each client library may behave slightly differently. Please check the documentation for the library you are using._