Skip to content

Conversation

@artembilan
Copy link
Member

Fixes #2971

  • Following best practice and well-known patterns with Jdbc, Rest or Jms templates, introduce default methods into LockRegistry interface to make it easier to perform tasks when within a lock.
  • Since all the required logic is now covered by those LockRegistry.executeLocked() methods, there is no need in the dedicated abstract WhileLockedProcessor class. Deprecated it for removal in the next version
  • Use a new LockRegistry.executeLocked() API in the FileWritingMessageHandler instead of just deprecated WhileLockedProcessor
  • To satisfy Java limitations for checked lambdas, introduce CheckedCallable and CheckedRunnable utilities similar to interfaces in the io.micrometer.observation.Observation
  • Change existing CheckedFunction to expose extra generic argument for Throwable
  • Add dedicated chapter for distributed lock into docs
  • Fix some links and typos in the docs

Fixes spring-projects#2971

* Following best practice and well-known patterns with `Jdbc`, `Rest` or `Jms` templates,
introduce `default` methods into `LockRegistry` interface to make it easier to perform
tasks when within a lock.
* Since all the required logic is now covered by those `LockRegistry.executeLocked()` methods,
there is no need in the dedicated abstract `WhileLockedProcessor` class.
Deprecated it for removal in the next version
* Use a new `LockRegistry.executeLocked()` API in the `FileWritingMessageHandler`
instead of just deprecated `WhileLockedProcessor`
* To satisfy Java limitations for checked lambdas, introduce `CheckedCallable` and `CheckedRunnable` utilities
similar to interfaces in the `io.micrometer.observation.Observation`
* Change existing `CheckedFunction` to expose extra generic argument for `Throwable`
* Add dedicated chapter for distributed lock into docs
* Fix some links and typos in the docs
Co-authored-by: Gary Russell <[email protected]>
@garyrussell garyrussell merged commit 6b8d37b into spring-projects:main Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add a LockTemplate to simplify working with distributed Locks in Spring Integration

2 participants