K
- the key type.V
- the value type.public interface ProducerFactory<K,V>
Producer
instance(s).Modifier and Type | Method and Description |
---|---|
default void |
closeProducerFor(java.lang.String transactionIdSuffix)
Remove the specified producer from the cache and close it.
|
default void |
closeThreadBoundProducer()
If the factory implementation uses thread-bound producers, call this method to
close and release this thread's producer.
|
org.apache.kafka.clients.producer.Producer<K,V> |
createProducer()
Create a producer.
|
default org.apache.kafka.clients.producer.Producer<K,V> |
createProducer(java.lang.String txIdPrefix)
Create a producer with an overridden transaction id prefix.
|
default boolean |
isProducerPerConsumerPartition()
Return the producerPerConsumerPartition.
|
default void |
reset()
Reset any state in the factory, if supported.
|
default boolean |
transactionCapable()
Return true if the factory supports transactions.
|
org.apache.kafka.clients.producer.Producer<K,V> createProducer()
default org.apache.kafka.clients.producer.Producer<K,V> createProducer(java.lang.String txIdPrefix)
txIdPrefix
- the transaction id prefix.default boolean transactionCapable()
default void closeProducerFor(java.lang.String transactionIdSuffix)
transactionIdSuffix
- the producer's transaction id suffix.default boolean isProducerPerConsumerPartition()
default void closeThreadBoundProducer()
default void reset()