akka.cluster.ClusterEvent.UnreachableMember Java Examples
The following examples show how to use
akka.cluster.ClusterEvent.UnreachableMember.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AkkaClusterListener.java From servicecomb-pack with Apache License 2.0 | 6 votes |
@Override public Receive createReceive() { return receiveBuilder() .match(MemberUp.class, mUp -> { LOG.info("Member is Up: {}", mUp.member()); }) .match(UnreachableMember.class, mUnreachable -> { LOG.info("Member detected as unreachable: {}", mUnreachable.member()); }) .match(MemberRemoved.class, mRemoved -> { LOG.info("Member is Removed: {}", mRemoved.member()); }) .match(MemberEvent.class, message -> { // ignore }) .matchAny(msg -> AKKA_LOG.warning("Received unknown message: {}", msg)) .build(); }
Example #2
Source File: SimpleClusterListener.java From akka-kubernetes-example with Apache License 2.0 | 6 votes |
@Override public void onReceive(Object message) { if (message instanceof MemberUp) { MemberUp mUp = (MemberUp) message; log.info("Member is Up: {}", mUp.member()); } else if (message instanceof UnreachableMember) { UnreachableMember mUnreachable = (UnreachableMember) message; log.info("Member detected as unreachable: {}", mUnreachable.member()); } else if (message instanceof MemberRemoved) { MemberRemoved mRemoved = (MemberRemoved) message; log.info("Member is Removed: {}", mRemoved.member()); } else if (message instanceof MemberEvent) { // ignore } else { unhandled(message); } }
Example #3
Source File: ClusterListener.java From flux with Apache License 2.0 | 6 votes |
/** * Overridden super class method. Receives callback messages for cluster membership changes. * Updates list of current cluster member addresses based on these updates * @see akka.actor.UntypedActor#onReceive(java.lang.Object) */ public void onReceive(Object message) { if (message instanceof MemberUp) { MemberUp mUp = (MemberUp) message; logger.info("Cluster Member is Up: " + mUp.member()); memberAddresses.add(mUp.member().address()); } else if (message instanceof UnreachableMember) { UnreachableMember mUnreachable = (UnreachableMember) message; logger.info("Cluster Member detected as unreachable " + mUnreachable.member()); } else if (message instanceof MemberRemoved) { MemberRemoved mRemoved = (MemberRemoved) message; logger.info("Cluster Member is Removed: " + mRemoved.member()); memberAddresses.remove(mRemoved.member().address()); } else if (message instanceof MemberEvent) { // ignore } else { unhandled(message); } }
Example #4
Source File: ClusterListener.java From akka-tutorial with Apache License 2.0 | 5 votes |
@Override public Receive createReceive() { return receiveBuilder().match(CurrentClusterState.class, state -> { this.log.info("Current members: {}", state.members()); }).match(MemberUp.class, mUp -> { this.log.info("Member is Up: {}", mUp.member()); }).match(UnreachableMember.class, mUnreachable -> { this.log.info("Member detected as unreachable: {}", mUnreachable.member()); }).match(MemberRemoved.class, mRemoved -> { this.log.info("Member is Removed: {}", mRemoved.member()); }).match(MemberEvent.class, message -> { // ignore }).build(); }
Example #5
Source File: ClusterListener.java From akka-tutorial with Apache License 2.0 | 5 votes |
@Override public Receive createReceive() { return receiveBuilder().match(CurrentClusterState.class, state -> { this.log.info("Current members: {}", state.members()); }).match(MemberUp.class, mUp -> { this.log.info("Member is Up: {}", mUp.member()); }).match(UnreachableMember.class, mUnreachable -> { this.log.info("Member detected as unreachable: {}", mUnreachable.member()); }).match(MemberRemoved.class, mRemoved -> { this.log.info("Member is Removed: {}", mRemoved.member()); }).match(MemberEvent.class, message -> { // ignore }).build(); }
Example #6
Source File: SimpleClusterListener.java From akka-kubernetes-example with Apache License 2.0 | 5 votes |
@Override public void preStart() { //#subscribe cluster.subscribe(getSelf(), ClusterEvent.initialStateAsEvents(), MemberEvent.class, UnreachableMember.class); //#subscribe }
Example #7
Source File: AkkaClusterListener.java From servicecomb-pack with Apache License 2.0 | 4 votes |
@Override public void preStart() { cluster.subscribe(getSelf(), ClusterEvent.initialStateAsEvents(), MemberEvent.class, UnreachableMember.class); }
Example #8
Source File: ClusterListener.java From akka-tutorial with Apache License 2.0 | 4 votes |
@Override public void preStart() { this.cluster.subscribe(this.self(), MemberEvent.class, UnreachableMember.class); }
Example #9
Source File: ClusterListener.java From akka-tutorial with Apache License 2.0 | 4 votes |
@Override public void preStart() { this.cluster.subscribe(this.self(), MemberEvent.class, UnreachableMember.class); }
Example #10
Source File: ClusterListener.java From flux with Apache License 2.0 | 4 votes |
/** * Overridden super class method. Sets up subscription for cluster membership changes * @see akka.actor.UntypedActor#preStart() */ public void preStart() { cluster.subscribe(getSelf(), ClusterEvent.initialStateAsEvents(), MemberEvent.class, UnreachableMember.class); }