Skip to content

Conversation

@NguyenHoangSon96
Copy link
Contributor

@NguyenHoangSon96 NguyenHoangSon96 commented Dec 3, 2025

Closes #

Proposed Changes

  • Replacing java.net.http with netty so that write and query api use the same HTTP client.
  • Introducing NettyHttpClientConfig allows users to configure Netty-related things like SSL, proxy. They will have to configure the proxy for the write api and query api separately. This class will be the only way to configure SSL and proxy; the old way will be removed. e.g: ClientConfig.disableServerCertificateValidation, ClientConfig.proxyUrl, ClientConfig.authenticator, ClientConfig.sslRootsFilePath, ClientConfig.proxy.

Changes

  • This pull request adds a new implementation of an HTTP client using Netty, enabling REST API communication for interacting with InfluxDB. It introduces several new classes, updates tests, and modifies existing configurations to integrate the Netty-based client.
  • Introduced a new Netty-based HTTP client for InfluxDB by adding classes like RestClient, ClientChannelInitializer, and ClientHandler for REST communication.
  • Updated test cases to accommodate SSL support, mutual TLS (mTLS), and extended error handling in the new client implementation.
  • Added dependency for netty-handler-proxy in pom.xml.
  • Updated InfluxDB client methods to support the new Netty-based REST client.
  • Refactored test data and added utility methods to handle SSL configurations for testing.
  • Enhanced error messaging and exception classes for better debugging and communication with the server.

Additional Information

  • I haven't written code comments and written all examples for the new changes yet because this is a big change, and I'm not very confident in my implementations, so I just want to hear opinions from everyone first.
  • I haven't implemented a follow-redirect for the rest client because implementing a follow-redirect with only core Netty is very hard, and not sure if it's needed.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 87.63441% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.59%. Comparing base (cbbf977) to head (a2303d2).

Files with missing lines Patch % Lines
...va/com/influxdb/v3/client/internal/RestClient.java 87.50% 5 Missing and 8 partials ⚠️
...m/influxdb/v3/client/internal/FlightSqlClient.java 14.28% 5 Missing and 1 partial ⚠️
...nfluxdb/v3/client/internal/InfluxDBClientImpl.java 75.00% 2 Missing and 1 partial ⚠️
...b/v3/client/internal/ClientChannelInitializer.java 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   86.78%   88.59%   +1.81%     
==========================================
  Files          20       24       +4     
  Lines        1294     1289       -5     
  Branches      215      210       -5     
==========================================
+ Hits         1123     1142      +19     
+ Misses         81       63      -18     
+ Partials       90       84       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NguyenHoangSon96 NguyenHoangSon96 force-pushed the feat/netty-client branch 2 times, most recently from 2409357 to 17091bb Compare December 8, 2025 04:35
@NguyenHoangSon96 NguyenHoangSon96 added this to the 1.8.0 milestone Dec 8, 2025
@jansimonb
Copy link
Contributor

@NguyenHoangSon96 , for the first round, please check this AI-generated review: pr-325-netty-client.md.

There is also a question of whether to keep the code backward compatible. The removed old configuration options were simple and easy to configure. For example I think it's easier to set a proxyUrl string than to set up ProxyDetector objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants