mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Update buffer.md
This commit is contained in:
parent
93d5c10525
commit
80613500f1
@ -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.
|
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._
|
> _As mentioned throughout this document, each client library may behave slightly differently. Please check the documentation for the library you are using._
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user