You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: subscribe toakka.cluster.ClusterEvent.ClusterDomainEventor subclasses, was [akka.cluster.ClusterEvent$ClusterDomainEvent, akka.remote.AssociationErrorEvent] at scala.Predef$.require(Predef.scala:224) at akka.cluster.Cluster.subscribe(Cluster.scala:233) at akka.cluster.Cluster.subscribe(Cluster.scala:214) at akka.cluster.Cluster.subscribe(Cluster.scala:213)
the source code in 2.11
def subscribe(subscriber: ActorRef, to: Class[_]): Unit = clusterCore ! InternalClusterAction.Subscribe(subscriber, to)
why change to 2.4.7
@varargs def subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Class[_]*): Unit = { require(to.length > 0, "at least oneClusterDomainEventclass is required") require( to.forall(classOf[ClusterDomainEvent].isAssignableFrom), s"subscribe toakka.cluster.ClusterEvent.ClusterDomainEventor subclasses, was [${to.map(_.getName).mkString(", ")}]") clusterCore ! InternalClusterAction.Subscribe(subscriber, initialStateMode, to.toSet) }
How to subscribe AssociationErrorEvent ?
The text was updated successfully, but these errors were encountered:
I don't know what you are comparing with, but it's documented since way back (at least 2.4.0) that "The to classes can be [[akka.cluster.ClusterEvent.ClusterDomainEvent]]"
AssociationErrorEvent is not a ClusterDomainEvent.
You can subscribe to system.eventStream for the AssociationErrorEvent
When i upgrade akka to 2.4.7
Cluster.get(system).subscribe(listener, ClusterDomainEvent.class, AssociationErrorEvent.class);
some problem like
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: subscribe to
akka.cluster.ClusterEvent.ClusterDomainEventor subclasses, was [akka.cluster.ClusterEvent$ClusterDomainEvent, akka.remote.AssociationErrorEvent] at scala.Predef$.require(Predef.scala:224) at akka.cluster.Cluster.subscribe(Cluster.scala:233) at akka.cluster.Cluster.subscribe(Cluster.scala:214) at akka.cluster.Cluster.subscribe(Cluster.scala:213)
the source code in 2.11
def subscribe(subscriber: ActorRef, to: Class[_]): Unit = clusterCore ! InternalClusterAction.Subscribe(subscriber, to)
why change to 2.4.7
@varargs def subscribe(subscriber: ActorRef, initialStateMode: SubscriptionInitialStateMode, to: Class[_]*): Unit = { require(to.length > 0, "at least one
ClusterDomainEventclass is required") require( to.forall(classOf[ClusterDomainEvent].isAssignableFrom), s"subscribe to
akka.cluster.ClusterEvent.ClusterDomainEventor subclasses, was [${to.map(_.getName).mkString(", ")}]") clusterCore ! InternalClusterAction.Subscribe(subscriber, initialStateMode, to.toSet) }
How to subscribe AssociationErrorEvent ?
The text was updated successfully, but these errors were encountered: