Hi, we are trying to set requireMaster=false when connecting to eventstore with the Java client. I was hoping this would distribute the connections among our 3 nodes in the cluster, but it looks like all connections are made to the leader node regardless. Digging into the client code, this section
final case class ClusterInfo(serverAddress: InetSocketAddress, members: List[MemberInfo]) {
lazy val bestNode: Option[MemberInfo] = {
val xs = members.filter { x => x.isAlive && x.state.isAllowedToConnect }
if (xs.isEmpty) None else Some(xs.maxBy(_.state))
}
}
it looks like .maxBy takes the node with the highest .id (leader has id=10 and follower has id=9)
we use dns for discovery.