Repository: camel Updated Branches: refs/heads/master a232ab0c5 -> 9ffb2549a
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/9ffb2549 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9ffb2549 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9ffb2549 Branch: refs/heads/master Commit: 9ffb2549a2af65e66d87bbca9651ea8f489e561d Parents: 325d476 Author: lburgazzoli <lburgazz...@gmail.com> Authored: Thu Oct 12 18:52:50 2017 +0200 Committer: lburgazzoli <lburgazz...@gmail.com> Committed: Thu Oct 12 18:54:08 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/9ffb2549/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 a6f9e50..6eae98c 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> getLeader() { - return Optional.of(this.localMember); + return this.localMember.isLeader() + ? Optional.of(this.localMember) + : Optional.empty(); } @Override