-
Notifications
You must be signed in to change notification settings - Fork 3k
Add maxLifetime to reactive datasource configurations
#34985
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
|
I can't find where tests are for things like |
|
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
This new class is not necessary. In Quarkus, all config properties defined as |
tsegismont
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.
Thank you @kdubb
See my other comment about unitised time
|
|
||
| === RabbitMQ | ||
|
|
||
| When using the `smallrye-reactive-messaging-rabbitmq` extension there is no configuration needed. The |
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.
Out of curiosity, what's different with the RabbitMQ extension? If the CredentialsProvider has the "expires-at property, couldn't we use the value to configure the pool correctly?
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.
RabbitMQ connections supports this automatically, it has built support for dynamic credentials.
Vert.x connection pooling does not support this. I made the PR to add max-lifetime to the Vert.x pool and in its current state I believe it would be hard to support this type of feature. Currently the SqlConnectionPool doesn't allow configuration of per-connection properties. If we gain the ability to set properties (specifically something like max lifetime) per connection this could be implemented
@tsegismont I am using that feature, and it is currently used for Previously The |
This comment has been minimized.
This comment has been minimized.
gsmet
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.
This will need a squash (thinking of the last commit).
Also, I would like to wait for the big Vert.x/datasource/config PR to go in before we rebase and merge this one as this one will conflict with it.
|
@gsmet Which PR is that? |
fdbb81b to
be79d01
Compare
|
Squashed & rabased. Left the separate doc update as a separate commit. |
This comment has been minimized.
This comment has been minimized.
Ok, thanks for the details. |
tsegismont
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.
Thank you @kdubb
This enables configuration of the new`maxLifetime` value provided by Vert.x 4.3 that ensures connections are recycled after a maximum duration. Because `maxLifetime` could conceivable be set beyond the maximum value that milliseconds can store in an `int` (24.8 days) I created a `UnitisedTime` class. The `UnitisedTime` class has a `unitised` method that converts a `Duration` into the smallest possible `TimeUnit` that can be stored in an int, starting with milliseconds. For consistency, I updated the `idleTimeout` to use the same `UnitisedTime.unitised` utitlity for conversion.
be79d01 to
7503e36
Compare
|
@kdubb I rebased the PR on top of my other PR and made the necessary adjustments. I also got rid of the lambdas as we try to avoid lambdas in runtime code. |
|
@gsmet LGTM |
Failing Jobs - Building 7503e36
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 17 #- Failing: integration-tests/kafka-oauth-keycloak
📦 integration-tests/kafka-oauth-keycloak✖ |
This enables configuration of the new
maxLifetimevalue provided by Vert.x4.4.2that ensures connections are recycled after a maximum duration.Because
maxLifetimecould conceivable be set beyond the maximum value that milliseconds can store in anint(24.8 days) I created aUnitisedTimeclass. TheUnitisedTimeclass has aunitisedmethod that converts aDurationinto the smallest possibleTimeUnitthat can be stored in anint, starting with milliseconds.For consistency, I updated the
idleTimeoutto use the sameUnitisedTime.unitisedutitlity for conversion.This was seemingly missed in PR #31873 and is required for use with the Vault Credentials Provider. To this end, I added a blurb about "Time Limited Credentials" to the Credentials Provider docs.