From 1bb81997fa70b917921ec6ef4e30d44149de0a35 Mon Sep 17 00:00:00 2001 From: Nerius Ilmonas <40357312+Neriuzz@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:20:00 +0000 Subject: [PATCH] Documentation improvement, explaining how to use starter lib (#19) * Slight documentation improvement * Add further documentation for configuring the datasources --- docs/usage.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 938295b..256ccea 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -18,8 +18,19 @@ dependencies { ## Configuration in Spring Boot Service -Add the `com.transferwise.common:tw-gaffer-jta-starter` dependency. +1. Add the `com.transferwise.common:tw-gaffer-jta-starter` dependency. +2. Expose all your HikariCP datasource's as beans. +3. `tw-gaffer-jta-starter` Will then automatically wrap all data sources and expose them as beans with Gaffer's `GafferJtaDataSource`. +4. If you need to configure the Gaffer datasource's, you can do so using the `GafferJtaProperties` class*. -It will create the necessary transaction manager objects and wrap all data sources exposed as beans with Gaffer's `GafferJtaDataSource`. - -You can configure each datasource via `GafferJtaProperties` class. \ No newline at end of file +\* You can do this in two ways: +1. Create a configuration entry in your `application.yml`, which will then cause the bean to be automatically created. For example: +```yaml +tw-gaffer-jta: + core: + databases: + mydb: + commitOrder: 15 + connectionValidationInterval: 31s +``` +2. Create the `GafferJtaProperties` bean yourself. \ No newline at end of file