Skip to content

Commit 2bd60cb

Browse files
rashtaoSimran-B
andauthored
[DE-535] Java Driver: configure Vert.x instance (#540)
* Java Driver: reuse Vert.x * Java Driver: documented HTTP protocol configuration to reuse Vert.x instance * Apply to other versions --------- Co-authored-by: Simran Spiller <[email protected]>
1 parent 1295042 commit 2bd60cb

File tree

4 files changed

+106
-2
lines changed

4 files changed

+106
-2
lines changed

Diff for: site/content/3.10/develop/drivers/java/reference-version-7/driver-setup.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,33 @@ Here are examples to integrate configuration properties from different sources:
8989
- `acquireHostListInterval(Integer)`: acquireHostList interval (ms), (default: `3_600_000`, 1 hour)
9090
- `loadBalancingStrategy(LoadBalancingStrategy)`: load balancing strategy, possible values are: `NONE`, `ROUND_ROBIN`, `ONE_RANDOM`, (default: `NONE`)
9191
- `responseQueueTimeSamples(Integer)`: amount of samples kept for queue time metrics, (default: `10`)
92-
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
92+
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
93+
- `protocolConfig(ProtocolConfig)`: configuration specific for the used protocol provider implementation
94+
95+
### HTTP Protocol Provider Configuration
96+
97+
The `ProtocolConfig` for the default HTTP protocol provider can be created via:
98+
99+
```java
100+
HttpProtocolConfig.builder()
101+
// ...
102+
.build();
103+
```
104+
105+
and configured using the following builder methods:
106+
107+
- `vertx(Vertx)`: Vert.x instance to use. If not set, a new instance is created.
108+
109+
For example, to reuse the existing Vert.x instance:
110+
111+
```java
112+
HttpProtocolConfig.builder()
113+
.protocolConfig(HttpProtocolConfig.builder()
114+
.vertx(Vertx.currentContext().owner())
115+
.build()
116+
)
117+
.build();
118+
```
93119

94120
### Config File Properties
95121

Diff for: site/content/3.11/develop/drivers/java/reference-version-7/driver-setup.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,33 @@ Here are examples to integrate configuration properties from different sources:
8989
- `acquireHostListInterval(Integer)`: acquireHostList interval (ms), (default: `3_600_000`, 1 hour)
9090
- `loadBalancingStrategy(LoadBalancingStrategy)`: load balancing strategy, possible values are: `NONE`, `ROUND_ROBIN`, `ONE_RANDOM`, (default: `NONE`)
9191
- `responseQueueTimeSamples(Integer)`: amount of samples kept for queue time metrics, (default: `10`)
92-
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
92+
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
93+
- `protocolConfig(ProtocolConfig)`: configuration specific for the used protocol provider implementation
94+
95+
### HTTP Protocol Provider Configuration
96+
97+
The `ProtocolConfig` for the default HTTP protocol provider can be created via:
98+
99+
```java
100+
HttpProtocolConfig.builder()
101+
// ...
102+
.build();
103+
```
104+
105+
and configured using the following builder methods:
106+
107+
- `vertx(Vertx)`: Vert.x instance to use. If not set, a new instance is created.
108+
109+
For example, to reuse the existing Vert.x instance:
110+
111+
```java
112+
HttpProtocolConfig.builder()
113+
.protocolConfig(HttpProtocolConfig.builder()
114+
.vertx(Vertx.currentContext().owner())
115+
.build()
116+
)
117+
.build();
118+
```
93119

94120
### Config File Properties
95121

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

+26
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,32 @@ 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+
- `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+
110+
- `vertx(Vertx)`: Vert.x instance to use. If not set, a new instance is created.
111+
112+
For example, to reuse the existing Vert.x instance:
113+
114+
```java
115+
HttpProtocolConfig.builder()
116+
.protocolConfig(HttpProtocolConfig.builder()
117+
.vertx(Vertx.currentContext().owner())
118+
.build()
119+
)
120+
.build();
121+
```
96122

97123
### Config File Properties
98124

Diff for: site/content/3.13/develop/drivers/java/reference-version-7/driver-setup.md

+26
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,32 @@ 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+
- `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+
110+
- `vertx(Vertx)`: Vert.x instance to use. If not set, a new instance is created.
111+
112+
For example, to reuse the existing Vert.x instance:
113+
114+
```java
115+
HttpProtocolConfig.builder()
116+
.protocolConfig(HttpProtocolConfig.builder()
117+
.vertx(Vertx.currentContext().owner())
118+
.build()
119+
)
120+
.build();
121+
```
96122

97123
### Config File Properties
98124

0 commit comments

Comments
 (0)