object KafkaClient
- Source
- KafkaClient.scala
- Alphabetic
- By Inheritance
- KafkaClient
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[F[_]](implicit instance: KafkaClient[F]): KafkaClient[F]
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def client[F[_]](ensemble: Set[BrokerAddress], protocol: protocol.kafka.ProtocolVersion.Value, clientName: String)(implicit arg0: Logger[F], arg1: Async[F], arg2: Network[F]): Resource[F, KafkaClient[F]]
Build a stream, that when run will produce single kafka client.
Build a stream, that when run will produce single kafka client.
Initially client spawns connections to nodes specified in ensemble and queries them for the topology. After topology is known, it then initiates connection to each Kafka Broker listed in topology. That connection is then used to publish messages to topic/partition that given broker is leader of.
For the subscription client always initiate separate connections to 'followers'. Only in such case there is no ISR (follower) available client initiate subscribe connection to 'leader'.
Client automatically reacts and recovers from any topology changes that may occur in ensemble:
- When the leader is changed, the publish requests goes to newly designated leader.
- When follower dies, or changes its role as leader, then subsequent reads are sent to another follower, if available.
- ensemble
Ensemble to connect to. Must not be empty.
- protocol
Protocol that will be used for requests. This shall be lowest common protocol supported by all brokers.
- clientName
Name of the client. Name is suffixed for different type of connections to broker:
- initial-meta-rq : Initial connection to query all available brokers
- control : Control connection where publish requests and maetadat requests are sent to
- fetch: Connection where fetch requests are sent to.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mk[F[_]](ensemble: Set[BrokerAddress], protocol: protocol.kafka.ProtocolVersion.Value, clientName: String, queryOffsetTimeout: FiniteDuration = 10.seconds, getLeaderDelay: FiniteDuration = 3.seconds, brokerMetadataReadTimeout: Option[FiniteDuration] = Some(10.seconds), publishFailMaxAttempts: Int = 3)(implicit arg0: Logger[F], arg1: Async[F], arg2: Network[F]): Resource[F, KafkaClient[F]]
- ensemble
Ensemble to connect to. Must not be empty.
- protocol
Protocol that will be used for requests. This shall be lowest common protocol supported by all brokers.
- clientName
Name of the client. Name is suffixed for different type of connections to broker:
- initial-meta-rq : Initial connection to query all available brokers
- control : Control connection where publish requests and metadata requests are sent to
- fetch: Connection where fetch requests are sent to.
- queryOffsetTimeout
Timeout to query any partition offset.
- getLeaderDelay
How often re-query for leader if the leader is not known. Applies only for publish connections.
- brokerMetadataReadTimeout
Maximum time we can take to read response from broker to a metadata request.
- publishFailMaxAttempts
Max number of attempts when publish to a topic fails, this is usually caused by kafka leader change.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object impl
- Attributes
- protected[kafka]