K - Type of the Key to be producedV - Type of the Value to be producedpublic class GenericProducer<K,V> extends Janitor.ManagedCloseable implements Producer<K,V>, java.lang.AutoCloseable
| Constructor and Description |
|---|
GenericProducer(io.axual.common.config.ClientConfig clientConfig,
BaseProducerConfig<K,V> producerConfig,
ProducerWorkerManager producerWorkerManager) |
GenericProducer(io.axual.common.config.ClientConfig clientConfig,
BaseProducerConfig<K,V> producerConfig,
ProducerWorkerManager producerWorkerManager,
ProduceJobFactory<K,V> jobFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection, the connection is re-opened after produce is called, or if after a
failed attempt to produce a retry is called.
|
java.util.concurrent.Future<ProducedMessage<K,V>> |
produce(ProducerMessage<K,V> message)
Method used to produce records, the implementation is dependent on the strategy
|
java.util.concurrent.Future<ProducedMessage<K,V>> |
produce(ProducerMessage<K,V> message,
ProduceCallback<K,V> produceCallback)
Method used to produce records, the implementation is dependent on the strategy
|
public GenericProducer(io.axual.common.config.ClientConfig clientConfig,
BaseProducerConfig<K,V> producerConfig,
ProducerWorkerManager producerWorkerManager)
public GenericProducer(io.axual.common.config.ClientConfig clientConfig,
BaseProducerConfig<K,V> producerConfig,
ProducerWorkerManager producerWorkerManager,
ProduceJobFactory<K,V> jobFactory)
public void close()
Producerpublic java.util.concurrent.Future<ProducedMessage<K,V>> produce(ProducerMessage<K,V> message)
Producerproduce in interface Producer<K,V>message - the message to be produced.GenericProducedMessage or a ExecutionException if the produce execution failedpublic java.util.concurrent.Future<ProducedMessage<K,V>> produce(ProducerMessage<K,V> message, ProduceCallback<K,V> produceCallback)
Producerproduce in interface Producer<K,V>message - the message to be producedproduceCallback - the callback implementation to be used to notify the producing applicationProducedMessage or a ExecutionException if the produce execution failedCopyright © 2020–2021 Axual B.V.. All rights reserved.