Skip to content

Commit 6d1f05f

Browse files
sleto-itmpv1989
authored andcommitted
Doc - TTL default + how to disable TTL + typo fix (#192)
* TTL default + how to disable TTL + typo fix
1 parent 920d166 commit 6d1f05f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/Drivers/Java/Reference/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,22 @@ The second load balancing strategy allows to pick a random host from the configu
124124

125125
## Connection time to live
126126

127-
Since version 4.4 the driver supports setting a TTL for connections managed by the internal connection pool. Setting a TTL helps when using load balancing strategy `ROUND_ROBIN`, because as soon as a coordinator goes down, every open connection to that host will be closed and opened again with another target coordinator. As long as the driver does not have to open new connections (all connections in the pool are used) it will use only the coordinators which never went down. To use the downed coordinator again, when it is running again, the connections in the connection pool have to be closed and opened again with the target host mentioned by the load balancing startegy. To achieve this you can manually call `ArangoDB.shutdown` in your client code or use the TTL for connection so that a downed coordinator (which is then brought up again) will be used again after a certain time.
127+
Since version 4.4 the driver supports setting a TTL for connections managed by the internal connection pool. Setting a TTL helps when using load balancing strategy `ROUND_ROBIN`, because as soon as a coordinator goes down, every open connection to that host will be closed and opened again with another target coordinator. As long as the driver does not have to open new connections (all connections in the pool are used) it will use only the coordinators which never went down. To use the downed coordinator again, when it is running again, the connections in the connection pool have to be closed and opened again with the target host mentioned by the load balancing strategy. To achieve this you can manually call `ArangoDB.shutdown` in your client code or use the TTL for connection so that a downed coordinator (which is then brought up again) will be used again after a certain time.
128128

129129
```Java
130130
ArangoDB arango = new ArangoDB.Builder().connectionTtl(5 * 60 * 1000).build();
131131
```
132132

133133
In this example all connections will be closed/reopened after 5 minutes.
134134

135+
Connection TTL can be disabled setting it to `null`:
136+
137+
```Java
138+
.connectionTtl(null)
139+
```
140+
141+
The default TTL is `null` (no automatic connection closure).
142+
135143
## configure VelocyPack serialization
136144

137145
Since version `4.1.11` you can extend the VelocyPack serialization by registering additional `VPackModule`s on `ArangoDB.Builder`.

0 commit comments

Comments
 (0)