-
Notifications
You must be signed in to change notification settings - Fork 8
docs: add durable example #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #253 +/- ##
=======================================
Coverage 90.14% 90.14%
=======================================
Files 20 20
Lines 1207 1207
Branches 188 188
=======================================
Hits 1088 1088
Misses 42 42
Partials 77 77 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jansimonb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, just few comments.
examples/src/main/java/com/influxdb/v3/durable/InfluxClientPool.java
Outdated
Show resolved
Hide resolved
examples/src/main/java/com/influxdb/v3/durable/DurableExample.java
Outdated
Show resolved
Hide resolved
…influxdb3-java into example/durable-example
|
I've made some recommended changes. I've also expanded explanations in comments. Since I ran across a flaky test failure in |
jansimonb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! 👍
Proposed Changes
Adds an example showing how to reuse and keep alive client instances for the duration of an application, as recommended in GRPC Best Practices. Clients should be created or recreated as little as possible and should be reused as much as possible.
The example illustrates using a primitive client pool that manages client instances while running four threads simultaneously handling influxdb calls. Two of these threads produce error responses from the server. Clients recover from these errors and can still be used for other calls.
This was motivated by research into a customer question about using connection pools for the query transport. Connection pools are already handled by the underlying GRPC ManagedChannel, which is designed to be long-running and robust. The write transport is similarly designed to recover from typical error responses.
Checklist