Currently, configuring the idleTimeout property of the connection pool will use the setIdleTimeout method on the HikariConfig configuration class.
Similarly, many of the other configuration parameters are duration values. The values range from millisecond, to second, to minute. This difference in order of magnitude can make it error-prone to configure the connection pool correctly, and review the configured values.
It would be great to be able to configure the connection pool using java.time.Duration values, for example
This makes the intent clear of the code more clear than the current
configuration.setIdleTimeout(300000)
configuration.setIdleTimeout(5 * 60 * 1000)
configuration.setIdleTimeout(10000) // 10 seconds, or did I make a typo got a zero too much or too little?
I am willing to build a pull request if this feature is found to be useful.
Implementation seems to be extending the HikariConfigMXBean with extra setter methods, and extending the implementation HikariConfig.
Furthermore, PropertyElf could be extended to take into account property values of the same syntax, for example:
# 5 minutes idle timeout, all properties are equivalent
idleTimeout = 300000
idleTimeout = 300s
idleTimeout = 5m
Currently, configuring the
idleTimeout
property of the connection pool will use thesetIdleTimeout
method on theHikariConfig
configuration class.Similarly, many of the other configuration parameters are duration values. The values range from millisecond, to second, to minute. This difference in order of magnitude can make it error-prone to configure the connection pool correctly, and review the configured values.
It would be great to be able to configure the connection pool using
java.time.Duration
values, for exampleThis makes the intent clear of the code more clear than the current
I am willing to build a pull request if this feature is found to be useful.
Implementation seems to be extending the
HikariConfigMXBean
with extra setter methods, and extending the implementationHikariConfig
.Furthermore,
PropertyElf
could be extended to take into account property values of the same syntax, for example: