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.
Attributes
- Companion
- object
- Source
- ProducerSettings.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
The time to wait for the Java KafkaProducer
to shutdown.
The time to wait for the Java KafkaProducer
to shutdown.
The default value is 60 seconds.
Attributes
- Source
- ProducerSettings.scala
A custom ExecutionContext to use for blocking Kafka operations.
A custom ExecutionContext to use for blocking Kafka operations. If not provided, the default blocking ExecutionContext provided by cats.effect.Sync will be used.
Attributes
- Source
- ProducerSettings.scala
Controls whether fs2.kafka.KafkaProducer.produce fails immediately if any org.apache.kafka.clients.producer.KafkaProducer.send callback resolves with error.
Controls whether fs2.kafka.KafkaProducer.produce fails immediately if any org.apache.kafka.clients.producer.KafkaProducer.send callback resolves with error.
When set to true
, the produce
method will fail fast, returning an error as soon as any record in the ProducerRecords fails to be sent.
The default value is false
, meaning the produce
method will not fail fast and will continue processing other records even if some callbacks fail.
Attributes
- Source
- ProducerSettings.scala
The Serializer
to use for serializing record keys.
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
.
Attributes
- Source
- ProducerSettings.scala
The Serializer
to use for serializing record values.
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
Creates a new ProducerSettings with the specified closeTimeout.
Creates a new ProducerSettings with the specified closeTimeout.
Attributes
- Source
- ProducerSettings.scala
Includes the credentials properties from the provided KafkaCredentialStore
Includes the credentials properties from the provided KafkaCredentialStore
Attributes
- Source
- ProducerSettings.scala
Returns a new ProducerSettings instance with the specified ExecutionContext to use for blocking operations.
Returns a new ProducerSettings instance with the specified ExecutionContext to use for blocking operations.
If not provided, the default blocking ExecutionContext provided by cats.effect.Sync will be used. If in doubt, leave this unset.
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
Creates a new ProducerSettings with the specified failFastProduce.
Creates a new ProducerSettings with the specified failFastProduce.
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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.
Attributes
- Source
- ProducerSettings.scala
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.
Attributes
- Source
- ProducerSettings.scala
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.
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
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
Attributes
- Source
- ProducerSettings.scala
Replace the serializers with those provided in the arguments.
Replace the serializers with those provided in the arguments.
Attributes
- Source
- ProducerSettings.scala