Producer Configurations

ProducerConfig

Package: io.axual.client.config

Use this class when you want to build a configuration for a non-AVRO producer.

Usage

ProducerConfig.builder() {
    .setKeySerializerClassName()
    .setValueSerializerClassName()
    .setDeliveryStrategy()
    .setOrderingStrategy()
    .setBatchSize()
    .setLingerMs()
    .setBlocking()
    .setMessageBufferSize()
    .setMessageBufferWaitTimeout()
    .build();
}

All configurations are defined below:

Configuration Default Value Description

keySerializerClassName

N/A

A fully qualified class name as String to serialize key.

valueSerializerClassName

N/A

A fully qualified class name as String to serialize value.

deliveryStrategy

N/A

Strategy to handle produce and retry behavior. More details are available at DeliveryStrategy.

orderingStrategy

LOSING_ORDER

Strategy to handle the ordering behavior. More details are available at OrderingStrategy.

batchSize

262144

Size in bytes of a group of messages that are batched together before sending by Kafka.

lingerMs

0

Time to wait in milliseconds before sending by Kafka. If set to zero, message is sent as soon as sender thread is available, even if only one message is in batch.

blocking

true

Indicate if the produce will block when the messageBuffer is full. If set to true, the produce will wait until a spot in the buffer becomes available.

messageBufferSize

1000

Amount of messages that can be in flight simultaneously.

messageBufferWaitTimeout

0

Amount of time to wait in milliseconds for a semaphore permit to become available before dropping the message

GenericAvroProducerConfig

Package: io.axual.client.config

Use this class when you want to build a configuration for a generic AVRO producer.

Usage

GenericAvroProducerConfig.builder() {
    .setKeySerializerClassName()
    .setValueSerializerClassName()
    .setDeliveryStrategy()
    .setOrderingStrategy()
    .setBatchSize()
    .setLingerMs()
    .setBlocking()
    .setMessageBufferSize()
    .setMessageBufferWaitTimeout()
    .build();
}

SpecificAvroProducerConfig

Package: io.axual.client.config

Use this class when you want to build a configuration for a specific AVRO producer.

Usage

SpecificAvroProducerConfig.builder() {
    .setKeySerializerClassName()
    .setValueSerializerClassName()
    .setDeliveryStrategy()
    .setOrderingStrategy()
    .setBatchSize()
    .setLingerMs()
    .setBlocking()
    .setMessageBufferSize()
    .setMessageBufferWaitTimeout()
    .build();
}