feat: enable HikariCP for server config #444
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There was a mysql connection issue in TMS and AIM-service-gms, and the current ebean connection pool makes it impossible to investigate. The mysql team suggested we migrate to HikariCP for better support from them.
Migration guide: https://shiny-chainsaw-yr6m6q9.pages.github.io/pages/migrating/JMP7.html
TLDR; the ServerConfig was originally setting DataSourceConfig (Ebean), and after migration to HikariCP, we should put the config in a HikariDataSource and use setDataSource instead of setDataSourceConfig.
Detail
To keep supporting Ebean pool, we will add a dual mode, so GMS that doesn't want to switch to Hikari can still make datahub-gma version upgrade. The only usage of the ServerConfig is changed to check if the config is a Hikari config first.
Note that Hikari config can't have a custom property like the old DataSourceConfig, so for GMS that needs to set values in custom property, e.g. SERVICE_IDENTIFIER, they have to stay with DataSourceConfig.
Testing Done
./gradlew build
Checklist