Commit a0ddc0e
committed
Safely add and register the MessageListener to Topic mapping.
Given addListener(:MessageListener, :Collection<Topic>) could be called concurrently from the addMessageListener(:MessageListener, Collection<Topic>) method by multiple Threads, and the RedisMessageListenerContainer Javadoc specifically states that it is safe to call the addMessageListener(..) method conurrently without any external synchronization, and the registeration (or mapping) of listener to Topics is a componund action, then a race condition is possible.
Closes #27551 parent 5778dec commit a0ddc0e
File tree
1 file changed
+4
-9
lines changed- src/main/java/org/springframework/data/redis/listener
1 file changed
+4
-9
lines changedLines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
649 | | - | |
| 648 | + | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
| 654 | + | |
| 655 | + | |
661 | 656 | | |
662 | 657 | | |
663 | 658 | | |
| |||
0 commit comments