GH-3010 Add idleBetweenTries for JdbcLockRegistry

Fixes https://github.com/spring-projects/spring-integration/issues/3010

Sometimes `100` milliseconds interval is too often to try to obtain a
lock with `UPDATE/INSERT` queries

**Cherry-pick to 5.1.x**
This commit is contained in:
Artem Bilan
2019-08-19 16:07:48 -04:00
committed by Gary Russell
parent f0807fe704
commit f600361237
2 changed files with 30 additions and 10 deletions

View File

@@ -1086,6 +1086,9 @@ The `timeToLive` (TTL) option on the `DefaultLockRepository` is provided for thi
You may also want to specify `CLIENT_ID` for the locks stored for a given `DefaultLockRepository` instance.
If so, you can specify the `id` to be associated with the `DefaultLockRepository` as a constructor parameter.
Starting with version 5.1.8, the `JdbcLockRegistry` can be configured with the `idleBetweenTries` - a `Duration` to sleep between lock record insert/update executions.
By default it is `100` milliseconds and in some environments non-leaders pollute connections with data source too often.
[[jdbc-metadata-store]]
=== JDBC Metadata Store