feat: add support for gRPC client interceptors in ClientConfig#360
feat: add support for gRPC client interceptors in ClientConfig#360NguyenHoangSon96 merged 9 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #360 +/- ##
==========================================
- Coverage 87.27% 87.26% -0.01%
==========================================
Files 20 20
Lines 1336 1343 +7
Branches 227 229 +2
==========================================
+ Hits 1166 1172 +6
Misses 81 81
- Partials 89 90 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
LGTM, let's ask Copilot now... |
There was a problem hiding this comment.
Pull request overview
This PR adds support for gRPC client interceptors in the ClientConfig, allowing users to pass custom interceptor functions to the Flight client for query operations. This enables use cases like custom header injection, logging, monitoring, or request modification at the gRPC layer.
Changes:
- Added
interceptorsfield to ClientConfig with getter and builder method - Updated FlightSqlClient to apply interceptors to the NettyChannelBuilder when configured
- Added test case demonstrating header injection via an interceptor
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| CHANGELOG.md | Documents the new feature for version 1.9.0 |
| src/main/java/com/influxdb/v3/client/config/ClientConfig.java | Adds interceptors field, getter, builder method, and updates equals/hashCode |
| src/main/java/com/influxdb/v3/client/internal/FlightSqlClient.java | Applies interceptors to NettyChannelBuilder when creating FlightClient |
| src/test/java/com/influxdb/v3/client/internal/FlightSqlClientTest.java | Adds test case verifying interceptor functionality with custom header injection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/com/influxdb/v3/client/internal/FlightSqlClientTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/main/java/com/influxdb/v3/client/config/ClientConfig.java:418
- The toString() method should include the interceptors field for consistency with other configuration fields. Most configuration fields like headers, defaultTags, sslRootsFilePath, and disableGRPCCompression are included in the string representation for debugging purposes. Add a line to include interceptors in the string representation.
@Override
public String toString() {
return new StringJoiner(", ", ClientConfig.class.getSimpleName() + "ClientConfig[", "]")
.add("host='" + host + "'")
.add("organization='" + organization + "'")
.add("database='" + database + "'")
.add("writePrecision=" + writePrecision)
.add("gzipThreshold=" + gzipThreshold)
.add("writeNoSync=" + writeNoSync)
.add("timeout=" + timeout)
.add("writeTimeout=" + writeTimeout)
.add("queryTimeout=" + queryTimeout)
.add("allowHttpRedirects=" + allowHttpRedirects)
.add("disableServerCertificateValidation=" + disableServerCertificateValidation)
.add("proxy=" + proxy)
.add("proxyUrl=" + proxyUrl)
.add("authenticator=" + authenticator)
.add("headers=" + headers)
.add("defaultTags=" + defaultTags)
.add("sslRootsFilePath=" + sslRootsFilePath)
.add("disableGRPCCompression=" + disableGRPCCompression)
.toString();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #
Proposed Changes
Checklist