SniffingNodeSelector

class SniffingNodeSelector(initialNodes: Node, maxNodeAge: Duration = 1.minutes, https: Boolean = false, user: String? = null, password: String? = null) : NodeSelector

If you are running against a cluster without a node balancer you can use this node selector to make the client sniff nodes from the cluster.

It will periodically sniff the cluster using the maxNodeAge parameter. You bootstrap it with at least 1 initialNodes.

The nextNode() function tries to return the same node for the same thread (jvm only) or AffinityId scope (you must set this up in your co routine scope). It falls back to randomly returning a node if no affinity or thread id is available.

Constructors

Link copied to clipboard
constructor(vararg initialNodes: Node, maxNodeAge: Duration = 1.minutes, https: Boolean = false, user: String? = null, password: String? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun selectNode(): Node