Class/Object

fs2.kafka

ProducerSettings

Related Docs: object ProducerSettings | package kafka

Permalink

sealed abstract class ProducerSettings[K, V] extends AnyRef

ProducerSettings contain settings necessary to create a KafkaProducer. At the very least, this includes a key serializer and a value serializer.

Several convenience functions are provided so that you don't have to work with String values and ProducerConfig for configuration. It's still possible to specify ProducerConfig values with functions like withProperty.

ProducerSettings instances are immutable and all modification functions return a new ProducerSettings instance.

Use ProducerSettings#apply to create a new instance.

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

Abstract Value Members

  1. abstract def closeTimeout: FiniteDuration

    Permalink

    The time to wait for the Java KafkaProducer to shutdown.

    The default value is 60 seconds.

  2. abstract def keySerializer: KafkaSerializer[K]

    Permalink

    The Serializer to use for serializing record keys.

  3. abstract def producerFactory: ProducerFactory

    Permalink

    The ProducerFactory for creating the Java Producer.

    The ProducerFactory for creating the Java Producer. The default is ProducerFactory#Default. Note that you normally don't need to have a custom ProducerFactory, and you should instead prefer to create a custom trait or class similar to KafkaProducer for testing purposes.

  4. abstract def properties: Map[String, String]

    Permalink

    Properties which can be provided when creating a Java KafkaProducer instance.

    Properties which can be provided when creating a Java KafkaProducer instance. Numerous functions in ProducerSettings add properties here if the settings are used by the Java KafkaProducer.

  5. abstract def valueSerializer: KafkaSerializer[V]

    Permalink

    The Serializer to use for serializing record values.

  6. abstract def withAcks(acks: Acks): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified acknowledgements.

    Returns a new ProducerSettings instance with the specified acknowledgements. This is equivalent to setting the following property using the withProperty function, except you can specify it with Acks instead of a String.

    ProducerConfig.ACKS_CONFIG
  7. abstract def withBatchSize(batchSize: Int): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified batch size.

    Returns a new ProducerSettings instance with the specified batch size. This is equivalent to setting the following property using the withProperty function, except you can specify it with an Int instead of a String.

    ProducerConfig.BATCH_SIZE_CONFIG
  8. abstract def withBootstrapServers(bootstrapServers: String): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified bootstrap servers.

    Returns a new ProducerSettings instance with the specified bootstrap servers. This is equivalent to setting the following property using the withProperty function.

    ProducerConfig.BOOTSTRAP_SERVERS_CONFIG
  9. abstract def withClientId(clientId: String): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified client id.

    Returns a new ProducerSettings instance with the specified client id. This is equivalent to setting the following property using the withProperty function.

    ProducerConfig.CLIENT_ID_CONFIG
  10. abstract def withCloseTimeout(closeTimeout: FiniteDuration): ProducerSettings[K, V]

    Permalink

    Creates a new ProducerSettings with the specified closeTimeout.

  11. abstract def withDeliveryTimeout(deliveryTimeout: FiniteDuration): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified delivery timeout.

    Returns a new ProducerSettings instance with the specified delivery timeout. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG
  12. abstract def withEnableIdempotence(enableIdempotence: Boolean): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified idempotence setting.

    Returns a new ProducerSettings instance with the specified idempotence setting. This is equivalent to setting the following property using the withProperty function, except you can specify it with a Boolean instead of a String.

    ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG
  13. abstract def withLinger(linger: FiniteDuration): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified linger.

    Returns a new ProducerSettings instance with the specified linger. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ProducerConfig.LINGER_MS_CONFIG
  14. abstract def withMaxInFlightRequestsPerConnection(maxInFlightRequestsPerConnection: Int): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified max in-flight requests per connection.

    Returns a new ProducerSettings instance with the specified max in-flight requests per connection. This is equivalent to setting the following property using the withProperty function, except you can specify it with an Int instead of a String.

    ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
  15. abstract def withProducerFactory(producerFactory: ProducerFactory): ProducerSettings[K, V]

    Permalink

    Creates a new ProducerSettings with the specified ProducerFactory as the producerFactory to use.

    Creates a new ProducerSettings with the specified ProducerFactory as the producerFactory to use. Note that under normal usage you don't need to have a custom ProducerFactory instance. For testing, you should prefer to create a custom trait or class similar to KafkaProducer.

  16. abstract def withProperties(properties: Map[String, String]): ProducerSettings[K, V]

    Permalink

    Includes the specified keys and values as properties.

    Includes the specified keys and values as properties. The keys should be part of the ProducerConfig keys, and the values should be valid choices for the keys.

  17. abstract def withProperties(properties: (String, String)*): ProducerSettings[K, V]

    Permalink

    Includes the specified keys and values as properties.

    Includes the specified keys and values as properties. The keys should be part of the ProducerConfig keys, and the values should be valid choices for the keys.

  18. abstract def withProperty(key: String, value: String): ProducerSettings[K, V]

    Permalink

    Includes a property with the specified key and value.

    Includes a property with the specified key and value. The key should be one of the keys in ProducerConfig, and the value should be a valid choice for the key.

  19. abstract def withRequestTimeout(requestTimeout: FiniteDuration): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified request timeout.

    Returns a new ProducerSettings instance with the specified request timeout. This is equivalent to setting the following property using the withProperty function, except you can specify it with a FiniteDuration instead of a String.

    ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG
  20. abstract def withRetries(retries: Int): ProducerSettings[K, V]

    Permalink

    Returns a new ProducerSettings instance with the specified retries.

    Returns a new ProducerSettings instance with the specified retries. This is equivalent to setting the following property using the withProperty function, except you can specify it with an Int instead of a String.

    ProducerConfig.RETRIES_CONFIG

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped