Skip to content

Commit ca541d3

Browse files
committed
Java Driver: documented HTTP protocol configuration to reuse Vert.x instance
1 parent a111b2f commit ca541d3

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

site/content/3.12/develop/drivers/java/reference-version-7/driver-setup.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,31 @@ Here are examples to integrate configuration properties from different sources:
9393
- `compressionThreshold(Integer)`: the minimum HTTP request body size (in bytes) to trigger compression, (default: `1024`)
9494
- `compressionLevel`: compression level between 0 and 9, (default: `6`)
9595
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
96-
- `reuseVertx(Boolean)`: reuse Vert.x instance to create HTTP connections, (default: `false`)
96+
- `protocolConfig(ProtocolConfig)`: configuration specific for the used protocol provider implementation
97+
98+
### HTTP Protocol Provider Configuration
99+
100+
The `ProtocolConfig` for the default HTTP protocol provider can be created via:
101+
102+
```java
103+
HttpProtocolConfig.builder()
104+
// ...
105+
.build();
106+
```
107+
108+
and configured using the following builder methods:
109+
- `vertx(Vertx)`: Vert.x instance to use, if not set a new instance will be created
110+
111+
For example, to reuse the existing Vert.x instance:
112+
113+
```java
114+
HttpProtocolConfig.builder()
115+
.protocolConfig(HttpProtocolConfig.builder()
116+
.vertx(Vertx.currentContext().owner())
117+
.build()
118+
)
119+
.build();
120+
```
97121

98122
### Config File Properties
99123

@@ -121,7 +145,6 @@ The properties read are:
121145
- `compression`: `NONE`, `DEFLATE` or `GZIP`
122146
- `compressionThreshold`
123147
- `compressionLevel`
124-
- `reuseVertx`
125148

126149
## SSL
127150

0 commit comments

Comments
 (0)