PartitionsFor

fs2.kafka.KafkaProducer.PartitionsFor
abstract class PartitionsFor[F[_], K, V] extends Metrics[F, K, V]

KafkaProducer.PartitionsFor extends KafkaProducer.Metrics to provide access to the underlying producer partitions.

Attributes

Source
KafkaProducer.scala
Graph
Supertypes
class Metrics[F, K, V]
class KafkaProducer[F, K, V]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def partitionsFor(topic: String): F[List[PartitionInfo]]

Returns partition metadata for the given topic.

Returns partition metadata for the given topic.

Attributes

See also

org.apache.kafka.clients.producer.KafkaProducer#partitionsFor

Source
KafkaProducer.scala

Inherited methods

def metrics: F[Map[MetricName, Metric]]

Returns producer metrics.

Returns producer metrics.

Attributes

See also

org.apache.kafka.clients.producer.KafkaProducer#metrics

Inherited from:
Metrics
Source
KafkaProducer.scala
def produce(records: ProducerRecords[K, V]): F[F[ProducerResult[K, V]]]

Produces the specified ProducerRecords in two steps: the first effect puts the records in the buffer of the producer, and the second effect waits for the records to send.

Produces the specified ProducerRecords in two steps: the first effect puts the records in the buffer of the producer, and the second effect waits for the records to send.

It's possible to flatten the result from this function to have an effect which both sends the records and waits for them to finish sending.

Waiting for individual records to send can substantially limit performance. In some cases, this is necessary, and so we might want to consider the following alternatives.

  • Wait for the produced records in batches, improving the rate at which records are produced, but loosing the guarantee where produce >> otherAction means otherAction executes after the record has been sent.

  • Run several produce.flatten >> otherAction concurrently, improving the rate at which records are produced, and still have otherAction execute after records have been sent, but losing the order of produced records.

Attributes

Inherited from:
KafkaProducer
Source
KafkaProducer.scala