Packages

trait Producer extends AnyRef

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Producer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def flush: Task[Unit]

    Flushes the producer's internal buffer.

    Flushes the producer's internal buffer. This will guarantee that all records currently buffered will be transmitted to the broker.

  2. abstract def metrics: Task[Map[MetricName, Metric]]

    Expose internal producer metrics

  3. abstract def partitionsFor(topic: String): Task[Chunk[PartitionInfo]]

    Get the partition metadata for the given topic

  4. abstract def produce[R, K, V](topic: String, key: K, value: V, keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, RecordMetadata]

    Produces a single record and await broker acknowledgement.

    Produces a single record and await broker acknowledgement.

    Use produceAsync to avoid the round-trip-time penalty for each record.

  5. abstract def produce[R, K, V](record: ProducerRecord[K, V], keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, RecordMetadata]

    Produces a single record and await broker acknowledgement.

    Produces a single record and await broker acknowledgement.

    Use produceAsync to avoid the round-trip-time penalty for each record.

  6. abstract def produce(record: ProducerRecord[Array[Byte], Array[Byte]]): Task[RecordMetadata]

    Produces a single record and await broker acknowledgement.

    Produces a single record and await broker acknowledgement.

    Use produceAsync to avoid the round-trip-time penalty for each record.

  7. abstract def produceAsync[R, K, V](topic: String, key: K, value: V, keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, Task[RecordMetadata]]

    Produces a single record.

    Produces a single record. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of the record to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the record.

    It is usually recommended to not await the inner layer of every individual record, but enqueue a batch of records and await all of their acknowledgements at once. That amortizes the cost of sending requests to Kafka and increases throughput.

  8. abstract def produceAsync[R, K, V](record: ProducerRecord[K, V], keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, Task[RecordMetadata]]

    Produces a single record.

    Produces a single record. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of the record to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the record.

    It is usually recommended to not await the inner layer of every individual record, but enqueue a batch of records and await all of their acknowledgements at once. That amortizes the cost of sending requests to Kafka and increases throughput.

  9. abstract def produceAsync(record: ProducerRecord[Array[Byte], Array[Byte]]): Task[Task[RecordMetadata]]

    Produces a single record.

    Produces a single record. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of the record to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the record.

    It is usually recommended to not await the inner layer of every individual record, but enqueue a batch of records and await all of their acknowledgements at once. That amortizes the cost of sending requests to Kafka and increases throughput.

  10. abstract def produceChunk[R, K, V](records: Chunk[ProducerRecord[K, V]], keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, Chunk[RecordMetadata]]

    Produces a chunk of records.

    Produces a chunk of records.

    Use produceChunkAsync to avoid the round-trip-time penalty for each record.

    When publishing any of the records fails, the whole batch fails even though some records might have been published. Use produceChunkAsyncWithFailures to get results per record.

  11. abstract def produceChunk(records: Chunk[ProducerRecord[Array[Byte], Array[Byte]]]): Task[Chunk[RecordMetadata]]

    Produces a chunk of records.

    Produces a chunk of records.

    Use produceChunkAsync to avoid the round-trip-time penalty for each record.

    When publishing any of the records fails, the whole batch fails even though some records might have been published. Use produceChunkAsyncWithFailures to get results per record.

  12. abstract def produceChunkAsync[R, K, V](records: Chunk[ProducerRecord[K, V]], keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): RIO[R, Task[Chunk[RecordMetadata]]]

    Produces a chunk of records.

    Produces a chunk of records. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of all the records to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the records.

    It is possible that for chunks that exceed the producer's internal buffer size, the outer layer will also signal the transmission of part of the chunk. Regardless, awaiting the inner layer guarantees the transmission of the entire chunk.

    When publishing any of the records fails, the whole batch fails even though some records might have been published. Use produceChunkAsyncWithFailures to get results per record.

  13. abstract def produceChunkAsync(records: Chunk[ProducerRecord[Array[Byte], Array[Byte]]]): Task[Task[Chunk[RecordMetadata]]]

    Produces a chunk of records.

    Produces a chunk of records. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of all the records to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the records.

    It is possible that for chunks that exceed the producer's internal buffer size, the outer layer will also signal the transmission of part of the chunk. Regardless, awaiting the inner layer guarantees the transmission of the entire chunk.

    When publishing any of the records fails, the whole batch fails even though some records might have been published. Use produceChunkAsyncWithFailures to get results per record.

  14. abstract def produceChunkAsyncWithFailures(records: Chunk[ProducerRecord[Array[Byte], Array[Byte]]]): UIO[UIO[Chunk[Either[Throwable, RecordMetadata]]]]

    Produces a chunk of records.

    Produces a chunk of records. The effect returned from this method has two layers and describes the completion of two actions:

    1. The outer layer describes the enqueueing of all the records to the Producer's internal buffer.
    2. The inner layer describes receiving an acknowledgement from the broker for the transmission of the records.

    It is possible that for chunks that exceed the producer's internal buffer size, the outer layer will also signal the transmission of part of the chunk. Regardless, awaiting the inner layer guarantees the transmission of the entire chunk.

    This variant of produceChunkAsync more accurately reflects that individual records within the Chunk can fail to publish, rather than the failure being at the level of the Chunk.

    When attempt to send a record into buffer for publication fails, the following records in the chunk are not published. This is indicated with a Producer.PublishOmittedException.

    This variant does not accept serializers as they may also fail independently of each record and this is not reflected in the return type.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. final def produceAll[R, K, V](keySerializer: Serializer[R, K], valueSerializer: Serializer[R, V]): ZPipeline[R, Throwable, ProducerRecord[K, V], RecordMetadata]

    A stream pipeline that produces all records from the stream.

  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped