Skip to content

Commit

Permalink
Documentation improvement, explaining how to use starter lib (#19)
Browse files Browse the repository at this point in the history
* Slight documentation improvement

* Add further documentation for configuring the datasources
  • Loading branch information
Neriuzz authored Mar 13, 2023
1 parent ab3957b commit 1bb8199
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
\* 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.

0 comments on commit 1bb8199

Please sign in to comment.