Skip to content

Commit 7da497d

Browse files
authored
Merge branch 'main' into dependabot/maven/io.netty-netty-tcnative-boringssl-static-2.0.70.Final
2 parents 9cfcae0 + b2126d1 commit 7da497d

35 files changed

+2786
-207
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ workflows:
160160
name: jdk-20
161161
maven-image: "cimg/openjdk:20.0"
162162
arg-line: "--add-opens=java.base/java.nio=ALL-UNNAMED"
163+
- tests-java:
164+
name: jdk-21
165+
maven-image: "cimg/openjdk:21.0"
166+
arg-line: "--add-opens=java.base/java.nio=ALL-UNNAMED"
163167
- deploy-snapshot:
164168
requires:
165169
- check-dependencies
@@ -168,6 +172,7 @@ workflows:
168172
- jdk-11
169173
- jdk-17
170174
- jdk-20
175+
- jdk-21
171176
filters:
172177
branches:
173178
only: main

CHANGELOG.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
1-
## 1.1.0 [unreleased]
1+
## 1.2.0 [unreleased]
2+
3+
### Features
4+
5+
1. [#209](https://github.com/InfluxCommunity/influxdb3-java/pull/209) Add query function returning row as map.
6+
2. [#238](https://github.com/InfluxCommunity/influxdb3-java/pull/238): Support fast writes without waiting for WAL
7+
persistence:
8+
- New write option (`WriteOptions.noSync`) added: `true` value means faster write but without the confirmation that
9+
the data was persisted. Default value: `false`.
10+
- **Supported by self-managed InfluxDB 3 Core and Enterprise servers only!**
11+
- Also configurable via connection string query parameter (`writeNoSync`).
12+
- Also configurable via environment variable (`INFLUX_WRITE_NO_SYNC`).
13+
- Long precision string values added from v3 HTTP API: `"nanosecond"`, `"microsecond"`, `"millisecond"`,
14+
`"second"` (
15+
in addition to the existing `"ns"`, `"us"`, `"ms"`, `"s"`).
16+
3. [#241](https://github.com/InfluxCommunity/influxdb3-java/pull/241): Some default options will be used from a getter.
17+
18+
### Bug Fixes
19+
20+
1. [#239](https://github.com/InfluxCommunity/influxdb3-java/pull/239): Use write options from `ClientConfig` in
21+
`InfluxDBClientImpl` write methods:
22+
23+
```java
24+
public void writeRecord(@Nullable final String record);
25+
public void writeRecords(@Nonnull final List<String> records);
26+
public void writePoint(@Nullable final Point point);
27+
public void writePoints(@Nonnull final List<Point> points);
28+
```
29+
30+
## 1.1.0 [2025-05-22]
31+
32+
### Features
33+
34+
1. [#229](https://github.com/InfluxCommunity/influxdb3-java/pull/229): Support proxy and custom ssl root certificates
35+
2. [#232](https://github.com/InfluxCommunity/influxdb3-java/pull/232): Allow set rpc max message size through maxInboundMessageSize in ClientConfig
36+
3. [#233](https://github.com/InfluxCommunity/influxdb3-java/pull/233): More detailed documentation about timestamp handling for query and write functions
37+
4. [#236](https://github.com/InfluxCommunity/influxdb3-java/pull/236): Supports Java 21.
238

339
## 1.0.0 [2024-12-11]
440

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ which allows you to execute SQL queries against InfluxDB IOx.
3333

3434
We offer this [Getting Started: InfluxDB 3.0 Java Client Library](https://www.youtube.com/watch?v=EFnG7rUDvR4) video for learning more about the library.
3535

36-
> :warning: This client requires Java 11 and is compatible up to and including Java 20.
36+
> :warning: This client requires Java 11 and is compatible up to and including Java 21.
3737
3838
## Installation
3939

@@ -47,15 +47,15 @@ Add the latest version of the client to your project:
4747
<dependency>
4848
<groupId>com.influxdb</groupId>
4949
<artifactId>influxdb3-java</artifactId>
50-
<version>1.0.0</version>
50+
<version>1.1.0</version>
5151
</dependency>
5252
```
5353

5454
### Or when using Gradle
5555

5656
```groovy
5757
dependencies {
58-
implementation "com.influxdb:influxdb3-java:1.0.0"
58+
implementation "com.influxdb:influxdb3-java:1.1.0"
5959
}
6060
```
6161

examples/docker-compose.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# The MIT License
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy
5+
# of this software and associated documentation files (the "Software"), to deal
6+
# in the Software without restriction, including without limitation the rights
7+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
# copies of the Software, and to permit persons to whom the Software is
9+
# furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in
12+
# all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
# THE SOFTWARE.
21+
#
22+
23+
version: "3"
24+
25+
services:
26+
envoy:
27+
image: envoyproxy/envoy:v1.26-latest
28+
volumes:
29+
- ./envoy.yaml:/etc/envoy/envoy.yaml
30+
ports:
31+
- "10000:10000"
32+
environment:
33+
- ENVOY_UID=0
34+

examples/envoy.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#
2+
# The MIT License
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy
5+
# of this software and associated documentation files (the "Software"), to deal
6+
# in the Software without restriction, including without limitation the rights
7+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
# copies of the Software, and to permit persons to whom the Software is
9+
# furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in
12+
# all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
# THE SOFTWARE.
21+
#
22+
23+
static_resources:
24+
listeners:
25+
- name: listener_0
26+
address:
27+
socket_address: { address: 0.0.0.0, port_value: 10000 }
28+
filter_chains:
29+
- filter_chain_match:
30+
filters:
31+
- name: envoy.filters.network.http_connection_manager
32+
typed_config:
33+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
34+
stat_prefix: ingress_http
35+
access_log:
36+
- name: envoy.access_loggers.stdout
37+
typed_config:
38+
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
39+
http2_protocol_options:
40+
allow_connect: true
41+
upgrade_configs:
42+
- upgrade_type: CONNECT
43+
http_filters:
44+
- name: envoy.filters.http.router
45+
typed_config:
46+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
47+
48+
route_config:
49+
name: local_route
50+
virtual_hosts:
51+
- name: local_service
52+
domains: [ "*" ]
53+
routes:
54+
- match:
55+
connect_matcher: { }
56+
route:
57+
cluster: influxdb_cluster
58+
upgrade_configs:
59+
upgrade_type: CONNECT
60+
connect_config: { }
61+
- match:
62+
prefix: "/"
63+
route:
64+
cluster: influxdb_cluster
65+
prefix_rewrite: "/"
66+
auto_host_rewrite: true
67+
timeout: 10s
68+
cors:
69+
allow_origin_string_match:
70+
- prefix: "*"
71+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
72+
clusters:
73+
- name: influxdb_cluster
74+
connect_timeout: 10s
75+
type: STRICT_DNS
76+
load_assignment:
77+
cluster_name: influxdb_cluster
78+
endpoints:
79+
- lb_endpoints:
80+
- endpoint:
81+
address:
82+
socket_address:
83+
address: "us-east-1-1.aws.cloud2.influxdata.com"
84+
port_value: 443

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>com.influxdb</groupId>
4141
<artifactId>influxdb3-java</artifactId>
42-
<version>1.1.0-SNAPSHOT</version>
42+
<version>1.2.0-SNAPSHOT</version>
4343
</dependency>
4444
</dependencies>
4545

examples/src/main/java/com/influxdb/v3/IOxExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static void main(final String[] args) throws Exception {
9898

9999
String influxQL =
100100
"select MEAN(value) from temperature group by time(1d) fill(none) order by time desc limit 10";
101-
try (Stream<Object[]> stream = client.query(influxQL, QueryOptions.INFLUX_QL)) {
101+
try (Stream<Object[]> stream = client.query(influxQL, QueryOptions.defaultInfluxQlQueryOptions())) {
102102
stream.forEach(row -> System.out.printf("| %-16s | %-18s |%n", row[1], row[2]));
103103
}
104104

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
* THE SOFTWARE.
21+
*/
22+
package com.influxdb.v3;
23+
24+
import java.util.UUID;
25+
import java.util.stream.Stream;
26+
27+
import com.influxdb.v3.client.InfluxDBClient;
28+
import com.influxdb.v3.client.Point;
29+
import com.influxdb.v3.client.PointValues;
30+
import com.influxdb.v3.client.config.ClientConfig;
31+
32+
public final class ProxyExample {
33+
34+
private ProxyExample() {
35+
}
36+
37+
public static void main(final String[] args) throws Exception {
38+
// Run docker-compose.yml file to start Envoy proxy
39+
40+
String proxyUrl = "http://localhost:10000";
41+
String sslRootsFilePath = "src/test/java/com/influxdb/v3/client/testdata/influxdb-certificate.pem";
42+
ClientConfig clientConfig = new ClientConfig.Builder()
43+
.host(System.getenv("INFLUXDB_URL"))
44+
.token(System.getenv("INFLUXDB_TOKEN").toCharArray())
45+
.database(System.getenv("INFLUXDB_DATABASE"))
46+
.proxyUrl(proxyUrl)
47+
.sslRootsFilePath(sslRootsFilePath)
48+
.build();
49+
50+
InfluxDBClient influxDBClient = InfluxDBClient.getInstance(clientConfig);
51+
String testId = UUID.randomUUID().toString();
52+
Point point = Point.measurement("My_Home")
53+
.setTag("room", "Kitchen")
54+
.setField("temp", 12.7)
55+
.setField("hum", 37)
56+
.setField("testId", testId);
57+
influxDBClient.writePoint(point);
58+
59+
String query = String.format("SELECT * FROM \"My_Home\" WHERE \"testId\" = '%s'", testId);
60+
try (Stream<PointValues> stream = influxDBClient.queryPoints(query)) {
61+
stream.findFirst().ifPresent(values -> {
62+
assert values.getTimestamp() != null;
63+
System.out.printf("room[%s]: %s, temp: %3.2f, hum: %d",
64+
new java.util.Date(values.getTimestamp().longValue() / 1000000),
65+
values.getTag("room"),
66+
(Double) values.getField("temp"),
67+
(Long) values.getField("hum"));
68+
});
69+
}
70+
}
71+
}
72+

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<groupId>com.influxdb</groupId>
2929
<artifactId>influxdb3-java</artifactId>
3030
<packaging>jar</packaging>
31-
<version>1.1.0-SNAPSHOT</version>
31+
<version>1.2.0-SNAPSHOT</version>
3232

3333
<name>InfluxDB 3 Java Client</name>
3434
<description>
@@ -399,7 +399,7 @@
399399
**/target/**, **/*.jar, **/.git/**, **/.*, **/*.png, **/*.iml, **/*.bolt, .idea/**,
400400
**/*nightly*/**, **/.m2/**, LICENSE, **/*.md, **/.github/**, license_header.txt,
401401
release.properties/, **/pom.xml.releaseBackup, **/pom.xml.tag, **/semantic.yml,
402-
.circleci/config.yml
402+
.circleci/config.yml, **/*.pem
403403
</excludes>
404404
</licenseSet>
405405
</licenseSets>

0 commit comments

Comments
 (0)