public static final class DefaultProducerFactory.Builder<K,V> extends Object
Modifier and Type | Method and Description |
---|---|
ProducerFactory<K,V> |
build() |
DefaultProducerFactory.Builder<K,V> |
withCloseTimeout(int timeout,
TimeUnit unit)
How long to wait when
Producer.close(long, TimeUnit) is invoked. |
DefaultProducerFactory.Builder<K,V> |
withConfirmationMode(ConfirmationMode confirmationMode)
Mode for producing
Producer . |
DefaultProducerFactory.Builder<K,V> |
withProducerCacheSize(int producerCacheSize)
How many producer instances to cache.
|
DefaultProducerFactory.Builder<K,V> |
withTransactionalIdPrefix(String transactionIdPrefix)
Transactional id prefix.
|
public DefaultProducerFactory.Builder<K,V> withProducerCacheSize(int producerCacheSize)
producerCacheSize
- the cache size.public DefaultProducerFactory.Builder<K,V> withCloseTimeout(int timeout, TimeUnit unit)
Producer.close(long, TimeUnit)
is invoked. Default is 30 seconds.timeout
- how long to wait before closing a producer, in units of
unit
.unit
- a TimeUnit
determining how to interpret the
timeout
parameter.public DefaultProducerFactory.Builder<K,V> withConfirmationMode(ConfirmationMode confirmationMode)
Producer
.confirmationMode,
- default to ConfirmationMode.NONE
.public DefaultProducerFactory.Builder<K,V> withTransactionalIdPrefix(String transactionIdPrefix)
transactionIdPrefix
- prefix to generate transactional.id
. Required for transactional
producers.public ProducerFactory<K,V> build()
Copyright © 2010–2018. All rights reserved.