You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2017/10/12 17:04:08 UTC

camel git commit: CAMEL-11902: cluster-service : FileLockClusterView should not always return local member as leader

Repository: camel
Updated Branches:
  refs/heads/camel-2.20.x cf32b912e -> b7ea17120


CAMEL-11902: cluster-service : FileLockClusterView should not always return local member as leader


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b7ea1712
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b7ea1712
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b7ea1712

Branch: refs/heads/camel-2.20.x
Commit: b7ea171209efdfef8a132c596772460a57bf365d
Parents: cf32b91
Author: lburgazzoli <lb...@gmail.com>
Authored: Thu Oct 12 18:52:50 2017 +0200
Committer: lburgazzoli <lb...@gmail.com>
Committed: Thu Oct 12 18:56:03 2017 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/file/ha/FileLockClusterView.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b7ea1712/camel-core/src/main/java/org/apache/camel/component/file/ha/FileLockClusterView.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/ha/FileLockClusterView.java b/camel-core/src/main/java/org/apache/camel/component/file/ha/FileLockClusterView.java
index 6fcf703..cfcdab2 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/ha/FileLockClusterView.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/ha/FileLockClusterView.java
@@ -56,7 +56,9 @@ public class FileLockClusterView extends AbstractCamelClusterView {
 
     @Override
     public Optional<CamelClusterMember> getMaster() {
-        return Optional.of(this.localMember);
+        return this.localMember.isLeader()
+            ? Optional.of(this.localMember)
+            : Optional.empty();
     }
 
     @Override