apupier commented on code in PR #27613:
URL: https://github.com/apache/camel/pull/27613#discussion_r4248370796


##########
components/camel-jgroups-raft/src/main/java/org/apache/camel/component/jgroups/raft/cluster/JGroupsRaftClusterView.java:
##########
@@ -83,12 +83,15 @@ protected void doStart() throws Exception {
         }
         fireLeadershipChangedEvent((CamelClusterMember) null);
 
+        // Register the listener once before attempting to connect; 
registering inside
+        // the retry loop would accumulate duplicate listeners across retries.
+        raftHandle.addRoleListener(new ClusterRoleChangeListener(this));

Review Comment:
   added in doStop and doShutdown



##########
components/camel-jgroups-raft/src/main/java/org/apache/camel/component/jgroups/raft/cluster/JGroupsRaftClusterView.java:
##########
@@ -108,8 +113,10 @@ protected void doStart() throws Exception {
     protected void doStop() throws Exception {

Review Comment:
   added in doStop



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to