You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the AWS Secrets Manager JDBC Driver in the Spring Boot framework to get credentials (user, password) and connect to the DB.
AWS Secrets Manager JDBC Library - https://github.com/aws/aws-secretsmanager-jdbc
Next, I uses HikariCP to reconnected(closed -> add) the Connection Pool every minute. The problem here is that the DB connection is reconnected every minute for 6 hours, but the GetSecretValue API occurs once when running the app.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Team,
I use the AWS Secrets Manager JDBC Driver in the Spring Boot framework to get credentials (user, password) and connect to the DB.
AWS Secrets Manager JDBC Library - https://github.com/aws/aws-secretsmanager-jdbc
Next, I uses HikariCP to reconnected(closed -> add) the Connection Pool every minute. The problem here is that the DB connection is reconnected every minute for 6 hours, but the GetSecretValue API occurs once when running the app.
In the following article, it is confirmed that the cache refreshes secrets every hour. So I think there should be a total of 5 GetSecretValue API calls over 6 hours.
Retrieve AWS Secrets Manager secrets in Java applications - https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_cache-java.html
[Log]
...
...
...
2023-09-21T19:54:02.456+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T19:54:02.457+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
2023-09-21T19:54:32.463+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T19:54:32.464+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
2023-09-21T19:54:43.968+09:00 DEBUG 25808 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@7a192bdc: (connection has passed maxLifetime)
2023-09-21T19:54:44.253+09:00 DEBUG 25808 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@7cf43350
2023-09-21T19:55:02.470+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T19:55:02.470+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
2023-09-21T19:55:32.473+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T19:55:32.474+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
2023-09-21T19:55:44.169+09:00 DEBUG 25808 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@7cf43350: (connection has passed maxLifetime)
2023-09-21T19:55:44.598+09:00 DEBUG 25808 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@5f85f1a1
...
...
...
2023-09-21T20:50:02.916+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T20:50:02.917+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
2023-09-21T20:50:20.940+09:00 DEBUG 25808 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@68717448: (connection has passed maxLifetime)
2023-09-21T20:50:21.304+09:00 DEBUG 25808 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@2a536079
2023-09-21T20:50:32.919+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2023-09-21T20:50:32.919+09:00 DEBUG 25808 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Fill pool skipped, pool is at sufficient level.
^C2023-09-21T20:51:00.774+09:00 INFO 25808 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-09-21T20:51:00.776+09:00 INFO 25808 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2023-09-21T20:51:00.776+09:00 DEBUG 25808 --- [ionShutdownHook] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Before shutdown stats (total=1, active=0, idle=1, waiting=0)
Was my analysis wrong? Or Does HikariCP have characteristics? I would like to get help this.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions