Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lock renewal for KinesisChannelAdapter
Related to spring-cloud/spring-cloud-stream-binder-aws-kinesis#148 The current implementation has a flaw when it uses a distributed lock for an exclusive access to shard for consuming only once at start up. Such a behavior cause the problem when we have a network glitch at runtime, so the lock is broken, but consumer is still active to retry consumption attempts * Add `renewLockIfAny()` logic ot the `ShardConsumer`, so we ensure that we are still a lock holder and don't consume otherwise * Add `unlockFuture` logic to block the `ShardConsumer.stop()` until we really got lock unlocked. Otherwise we end up with the race condition when we are still stopping, but already ready to start a new consumer for the same shard
- Loading branch information
1 parent
c15e345
commit ac74dfd
Showing
1 changed file
with
104 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters