Packages

final case class ProducerSettings(closeTimeout: zio.Duration = 30.seconds, sendBufferSize: Int = 4096, authErrorRetrySchedule: Schedule[Any, Throwable, Any] = Schedule.stop, properties: Map[String, AnyRef] = Map.empty, diagnostics: ProducerDiagnostics = Producer.NoDiagnostics, metricLabels: Set[MetricLabel] = Set.empty) extends Product with Serializable

Settings for the Producer.

To stay source compatible with future releases, you are recommended to construct the settings as follows:

ProducerSettings(bootstrapServers)
  .withLinger(500.millis)
  .withCompression(ProducerCompression.Zstd(3))
  .... etc.
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProducerSettings
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ProducerSettings(closeTimeout: zio.Duration = 30.seconds, sendBufferSize: Int = 4096, authErrorRetrySchedule: Schedule[Any, Throwable, Any] = Schedule.stop, properties: Map[String, AnyRef] = Map.empty, diagnostics: ProducerDiagnostics = Producer.NoDiagnostics, metricLabels: Set[MetricLabel] = Set.empty)

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. val authErrorRetrySchedule: Schedule[Any, Throwable, Any]
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. val closeTimeout: zio.Duration
  8. val diagnostics: ProducerDiagnostics
  9. def driverSettings: Map[String, AnyRef]
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. val metricLabels: Set[MetricLabel]
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. def productElementNames: Iterator[String]
    Definition Classes
    Product
  18. val properties: Map[String, AnyRef]
  19. val sendBufferSize: Int
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. def withAuthErrorRetrySchedule(authErrorRetrySchedule: Schedule[Any, Throwable, Any]): ProducerSettings

    Configure retries for authorization or authentication errors.

    Configure retries for authorization or authentication errors.

    If you want to retry other (retriable) exceptions, please use the retries configuration property.

    ⚠️ Retrying may cause records to be produced in a different order than the order in which they were given to zio-kafka.

    authErrorRetrySchedule

    The schedule at which the producer will retry producing, even when producing fails with an org.apache.kafka.common.errors.AuthorizationException or org.apache.kafka.common.errors.AuthenticationException. This setting helps with failed producing due to too slow authorization or authentication in the broker. For example, to retry 5 times, spaced by 500ms, you can set this to

    Schedule.recurs(5) && Schedule.spaced(500.millis)

    The default is Schedule.stop which is, to fail the producer on the first auth error.

  25. def withBootstrapServers(servers: List[String]): ProducerSettings
  26. def withClientId(clientId: String): ProducerSettings
  27. def withCloseTimeout(duration: zio.Duration): ProducerSettings
  28. def withCompression(compression: ProducerCompression): ProducerSettings

    compression

    The compression codec to use when publishing records. Compression is of full batches of data, so the efficacy of batching will also impact the compression ratio (more batching means better compression). See also withLinger.

  29. def withCredentials(credentialsStore: KafkaCredentialStore): ProducerSettings
  30. def withDiagnostics(diagnostics: ProducerDiagnostics): ProducerSettings

    diagnostics

    an optional callback for key events in the producer life-cycle. The callbacks will be executed in a separate fiber. Since the events are queued, failure to handle these events leads to out of memory errors.

  31. def withLinger(lingerDuration: zio.Duration): ProducerSettings

    lingerDuration

    The maximum amount of time a record is allowed to linger in the producer's internal buffer. Higher values allow for better batching (especially important when compression is used), lower values reduce latency and memory usage.

  32. def withMetricsLabels(metricLabels: Set[MetricLabel]): ProducerSettings

    metricLabels

    The labels given to all metrics collected by the zio-kafka producer. By default, no labels are set. For applications with multiple producers it is recommended to set some metric labels. For example, one can imagine a producer-id that can be used as a label:

    producerSettings.withMetricLabels(Set(MetricLabel("producer-id", producerId)))
  33. def withProperties(kvs: Map[String, AnyRef]): ProducerSettings
  34. def withProperties(kvs: (String, AnyRef)*): ProducerSettings
  35. def withProperty(key: String, value: AnyRef): ProducerSettings
  36. def withSendBufferSize(sendBufferSize: Int): ProducerSettings

    sendBufferSize

    The maximum number of record chunks that can queue up while waiting for the underlying producer to become available. Performance critical users that publish a lot of records one by one (instead of in chunks), should consider increasing this value, for example to 10240.

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 Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped