Skip to content
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

Add documentation about needed recycling for db credentials provider #149

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/modules/ROOT/pages/vault-datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,20 @@ is not the owner. As expected this will fail. As a result, it is recommended to
`quarkus.hibernate-orm.database.generation=update` in this section.
====

Finally, we need to tell our Quarkus database configuration to recycle connections before the lease TTL we
configured in Vault. This will ensure the database connection will always use valid credentials.

In this example the default TTL is set to 1 hour, so we will recycle connections every 30 minutes:
----
quarkus.datasource.jdbc.max-lifetime=30m
----

[NOTE]
====
When using a reactive datasource you will need to use the `quarkus.datasource.reactive.idle-timeout` option instead.
====


Recompile with `./mvnw package`, start and test the `gift-count` endpoint. You should see `0` again.

Notice in the logs:
Expand Down