class ProducerSettings[K, V] extends AnyRef

Settings for producers. See akka.kafka.producer section in reference.conf. Note that the companion object provides apply and create functions for convenient construction of the settings, together with the with methods.

The constructor is Internal API.

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

Value Members

  1. val closeProducerOnStop: Boolean
  2. val closeTimeout: FiniteDuration
  3. def createKafkaProducer(): Producer[K, V]

    Create a Producer instance from these settings.

    Create a Producer instance from these settings.

    This will fail with IllegalStateException if asynchronous enrichment is set up -- always prefer createKafkaProducerAsync() or createKafkaProducerCompletionStage().

    Exceptions thrown

    IllegalStateException if asynchronous enrichment is set via withEnrichAsync or withEnrichCompletionStage, you must use createKafkaProducerAsync / createKafkaProducerCompletionStage to apply it

  4. def createKafkaProducerAsync()(implicit executionContext: ExecutionContext): Future[Producer[K, V]]

    Scala API.

    Scala API.

    Create a Kafka Producer instance from these settings (without blocking for enriched).

  5. def createKafkaProducerCompletionStage(executor: Executor): CompletionStage[Producer[K, V]]

    Java API.

    Java API.

    Create a Kafka Producer instance from these settings (without blocking for enriched).

    executor

    Executor for asynchronous producer creation

  6. val dispatcher: String
  7. val enrichAsync: Option[(ProducerSettings[K, V]) => Future[ProducerSettings[K, V]]]
  8. def enriched: Future[ProducerSettings[K, V]]

    Applies enrichAsync to complement these settings from asynchronous sources.

  9. val eosCommitInterval: FiniteDuration
  10. def getProperties: Map[String, AnyRef]

    Get the Kafka producer settings as map.

  11. def getProperty(key: String): String

    Java API: Get a raw property.

    Java API: Get a raw property. null if it is not defined.

  12. val keySerializerOpt: Option[Serializer[K]]
  13. val parallelism: Int
  14. val producerFactorySync: Option[(ProducerSettings[K, V]) => Producer[K, V]]
  15. val properties: Map[String, String]
  16. def toString(): String
    Definition Classes
    ProducerSettings → AnyRef → Any
  17. val transactionIdPrefix: String
  18. val valueSerializerOpt: Option[Serializer[V]]
  19. def withBootstrapServers(bootstrapServers: String): ProducerSettings[K, V]

    A comma-separated list of host/port pairs to use for establishing the initial connection to the Kafka cluster.

  20. def withClientId(clientId: String): ProducerSettings[K, V]

    An id string to pass to the server when making requests.

    An id string to pass to the server when making requests. The purpose of this is to be able to track the source of requests beyond just ip/port by allowing a logical application name to be included in server-side request logging.

  21. def withCloseProducerOnStop(closeProducerOnStop: Boolean): ProducerSettings[K, V]

    Call KafkaProducer.close on the org.apache.kafka.clients.producer.KafkaProducer when the producer stage receives a shutdown signal.

  22. def withCloseTimeout(closeTimeout: Duration): ProducerSettings[K, V]

    Java API: Duration to wait for KafkaProducer.close to finish.

  23. def withCloseTimeout(closeTimeout: FiniteDuration): ProducerSettings[K, V]

    Duration to wait for KafkaProducer.close to finish.

  24. def withDispatcher(dispatcher: String): ProducerSettings[K, V]

    Fully qualified config path which holds the dispatcher configuration to be used by the producer stages.

    Fully qualified config path which holds the dispatcher configuration to be used by the producer stages. Some blocking may occur. When this value is empty, the dispatcher configured for the stream will be used.

  25. def withEnrichAsync(value: (ProducerSettings[K, V]) => Future[ProducerSettings[K, V]]): ProducerSettings[K, V]

    Scala API.

    Scala API. A hook to allow for resolving some settings asynchronously.

    Since

    2.0.0

  26. def withEnrichCompletionStage(value: Function[ProducerSettings[K, V], CompletionStage[ProducerSettings[K, V]]]): ProducerSettings[K, V]

    Java API.

    Java API. A hook to allow for resolving some settings asynchronously.

    Since

    2.0.0

  27. def withEosCommitInterval(eosCommitInterval: Duration): ProducerSettings[K, V]

    Java API: The time interval to commit a transaction when using the Transactional.sink or Transactional.flow.

  28. def withEosCommitInterval(eosCommitInterval: FiniteDuration): ProducerSettings[K, V]

    The time interval to commit a transaction when using the Transactional.sink or Transactional.flow.

  29. def withParallelism(parallelism: Int): ProducerSettings[K, V]

    Tuning parameter of how many sends that can run in parallel.

  30. def withProducer(producer: Producer[K, V]): ProducerSettings[K, V]

    Replaces the default Kafka producer creation logic with an external producer.

    Replaces the default Kafka producer creation logic with an external producer. This will also set closeProducerOnStop = false by default.

  31. def withProducerFactory(factory: (ProducerSettings[K, V]) => Producer[K, V]): ProducerSettings[K, V]

    Replaces the default Kafka producer creation logic.

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

    Java API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.producer.ProducerConfig.

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

    Scala API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.producer.ProducerConfig.

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

    Scala API: The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.producer.ProducerConfig.

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

    The raw properties of the kafka-clients driver, see constants in org.apache.kafka.clients.producer.ProducerConfig.

  36. def withTransactionIdPrefix(transactionIdPrefix: String): ProducerSettings[K, V]

    The prefix to append to the generated transaction id when using the Transactional.sink or Transactional.flow.

Deprecated Value Members

  1. def producerFactory: (ProducerSettings[K, V]) => Producer[K, V]
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use createKafkaProducer(), createKafkaProducerAsync(), or createKafkaProducerCompletionStage() to get a new KafkaProducer