From f825ed1ef785fba68c2b37fa5f21e2d96ccc83aa Mon Sep 17 00:00:00 2001 From: hongwei Date: Fri, 13 Oct 2023 15:44:01 +0200 Subject: [PATCH] docfix/remove hikari.metricRegistry props and tweak the docs --- .../src/main/resources/props/sample.props.template | 3 +-- .../scala/bootstrap/liftweb/CustomDBVendor.scala | 14 +++++--------- release_notes.md | 1 - 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 222465076..f37b8326d 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -23,14 +23,13 @@ connector=star #connector=proxy #connector=... -#OBP uses Hikari as the default database connection pool. OBP supports the following 6 configurations at the moment. +#OBP uses Hikari as the default database connection pool. OBP supports the following 5 configurations at the moment. #https://github.com/brettwooldridge/HikariCP#frequently-used #hikari.connectionTimeout= #hikari.maximumPoolSize= #hikari.idleTimeout= #hikari.keepaliveTime= #hikari.maxLifetime= -#hikari.metricRegistry= ## if connector = star, then need to set which connectors will be used. For now, obp support rest, akka, kafka. If you set kafka, then you need to start the kafka server. starConnector_supported_types=mapped,internal diff --git a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala index fe7025343..47db52532 100644 --- a/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala +++ b/obp-api/src/main/scala/bootstrap/liftweb/CustomDBVendor.scala @@ -29,29 +29,25 @@ class CustomDBVendor(driverName: String, val config = new HikariConfig() val connectionTimeout = APIUtil.getPropsAsLongValue("hikari.connectionTimeout") - val maximumPoolSize = APIUtil.getPropsAsLongValue("hikari.maximumPoolSize") + val maximumPoolSize = APIUtil.getPropsAsIntValue("hikari.maximumPoolSize") val idleTimeout = APIUtil.getPropsAsLongValue("hikari.idleTimeout") val keepaliveTime = APIUtil.getPropsAsLongValue("hikari.keepaliveTime") val maxLifetime = APIUtil.getPropsAsLongValue("hikari.maxLifetime") - val metricRegistry = APIUtil.getPropsAsLongValue("hikari.metricRegistry") if(connectionTimeout.isDefined){ config.setConnectionTimeout(connectionTimeout.head) } if(maximumPoolSize.isDefined){ - config.setConnectionTimeout(maximumPoolSize.head) + config.setMaximumPoolSize(maximumPoolSize.head) } if(idleTimeout.isDefined){ - config.setConnectionTimeout(idleTimeout.head) + config.setIdleTimeout(idleTimeout.head) } if(keepaliveTime.isDefined){ - config.setConnectionTimeout(keepaliveTime.head) + config.setKeepaliveTime(keepaliveTime.head) } if(maxLifetime.isDefined){ - config.setConnectionTimeout(maxLifetime.head) - } - if(metricRegistry.isDefined){ - config.setConnectionTimeout(connectionTimeout.head) + config.setMaxLifetime(maxLifetime.head) } (dbUser, dbPassword) match { diff --git a/release_notes.md b/release_notes.md index 4fe3b1ccf..a14351198 100644 --- a/release_notes.md +++ b/release_notes.md @@ -8,7 +8,6 @@ Date Commit Action Added props hikari.idleTimeout, default is from hakari. Added props hikari.keepaliveTime, default is from hakari. Added props hikari.maxLifetime, default is from hakari. - Added props hikari.metricRegistry, default is from hakari. 24/08/2023 bcb8fcfd Added props expectedOpenFuturesPerService, default is 100. 16/08/2023 4d8dfa66 Added props short_endpoint_timeout, default is 1. Added props medium_endpoint_timeout, default is 7.