K - Key type.V - Value type.public class SwitchingProducer<K,V> extends SwitchingProxy<ProducerProxy<K,V>,SwitchingProducerConfig<K,V>> implements ProducerProxy<K,V>
| Constructor and Description |
|---|
SwitchingProducer(java.util.Map<java.lang.String,java.lang.Object> configs) |
SwitchingProducer(java.util.Map<java.lang.String,java.lang.Object> configs,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valueSerializer) |
SwitchingProducer(java.util.Properties properties) |
SwitchingProducer(java.util.Properties properties,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valueSerializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction()
See
KafkaProducer.abortTransaction() |
void |
beginTransaction()
Start a transaction.
|
void |
commitTransaction()
See
KafkaProducer.commitTransaction() |
void |
flush()
See
KafkaProducer.flush() |
void |
initTransactions()
Register the producer with the transaction coordinator of the cluster.
|
java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> |
metrics()
See
KafkaProducer.metrics() |
java.util.List<org.apache.kafka.common.PartitionInfo> |
partitionsFor(java.lang.String topic)
See
KafkaProducer.partitionsFor(String) |
java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> |
send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
See
KafkaProducer.send(ProducerRecord) |
java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> |
send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record,
org.apache.kafka.clients.producer.Callback callback)
See
KafkaProducer.send(ProducerRecord, Callback) |
void |
sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets,
org.apache.kafka.clients.consumer.ConsumerGroupMetadata groupMetadata)
See
KafkaProducer.sendOffsetsToTransaction(Map, ConsumerGroupMetadata) |
void |
sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets,
java.lang.String consumerGroupId)
See
KafkaProducer.sendOffsetsToTransaction(Map, String) |
getCurrentDiscoveryResult, getDiscoveryProperty, getReadLock, getSwitcher, maybeReplaceProxiedObject, maybeReplaceProxiedObjectclose, close, getConfig, getConfigs, getWriteLockoperationNotSupported, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, close, getConfig, getConfigs, getStringConfigpublic SwitchingProducer(java.util.Map<java.lang.String,java.lang.Object> configs)
public SwitchingProducer(java.util.Map<java.lang.String,java.lang.Object> configs,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valueSerializer)
public SwitchingProducer(java.util.Properties properties)
public void initTransactions()
public void beginTransaction()
public void sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets,
java.lang.String consumerGroupId)
KafkaProducer.sendOffsetsToTransaction(Map, String)sendOffsetsToTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>TransactionSwitchedException - if the producer switches over to another cluster during a transaction.public void sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets,
org.apache.kafka.clients.consumer.ConsumerGroupMetadata groupMetadata)
throws org.apache.kafka.common.errors.ProducerFencedException
KafkaProducer.sendOffsetsToTransaction(Map, ConsumerGroupMetadata)sendOffsetsToTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>TransactionSwitchedException - if the producer switches over to another cluster during a transaction.org.apache.kafka.common.errors.ProducerFencedExceptionpublic void commitTransaction()
KafkaProducer.commitTransaction()public void abortTransaction()
KafkaProducer.abortTransaction()public java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
KafkaProducer.send(ProducerRecord)send in interface org.apache.kafka.clients.producer.Producer<K,V>TransactionSwitchedException - if the producer switches over to another cluster during a transaction.public java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record, org.apache.kafka.clients.producer.Callback callback)
KafkaProducer.send(ProducerRecord, Callback)send in interface org.apache.kafka.clients.producer.Producer<K,V>TransactionSwitchedException - if the producer switches over to another cluster during a transaction.public void flush()
KafkaProducer.flush()public java.util.List<org.apache.kafka.common.PartitionInfo> partitionsFor(java.lang.String topic)
KafkaProducer.partitionsFor(String)Copyright © 2020–2022 Axual B.V.. All rights reserved.