Package org.springframework.kafka.core
Class DefaultKafkaProducerFactory.CloseSafeProducer<K,V>
java.lang.Object
org.springframework.kafka.core.DefaultKafkaProducerFactory.CloseSafeProducer<K,V>
- Type Parameters:
K
- the key type.V
- the value type.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.clients.producer.Producer<K,
V>
- Enclosing class:
- DefaultKafkaProducerFactory<K,
V>
protected static class DefaultKafkaProducerFactory.CloseSafeProducer<K,V>
extends Object
implements org.apache.kafka.clients.producer.Producer<K,V>
A wrapper class for the delegate.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
org.apache.kafka.common.Uuid
clientInstanceId
(Duration timeout) void
close()
void
void
void
flush()
void
Map<org.apache.kafka.common.MetricName,
? extends org.apache.kafka.common.Metric> metrics()
List<org.apache.kafka.common.PartitionInfo>
partitionsFor
(String topic) Future<org.apache.kafka.clients.producer.RecordMetadata>
Future<org.apache.kafka.clients.producer.RecordMetadata>
send
(org.apache.kafka.clients.producer.ProducerRecord<K, V> record, org.apache.kafka.clients.producer.Callback callback) void
sendOffsetsToTransaction
(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, String consumerGroupId) void
sendOffsetsToTransaction
(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, org.apache.kafka.clients.consumer.ConsumerGroupMetadata groupMetadata) toString()
-
Method Details
-
send
-
send
-
flush
public void flush() -
partitionsFor
-
metrics
-
clientInstanceId
-
initTransactions
public void initTransactions() -
beginTransaction
public void beginTransaction() throws org.apache.kafka.common.errors.ProducerFencedException -
sendOffsetsToTransaction
-
sendOffsetsToTransaction
public void sendOffsetsToTransaction(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 -
commitTransaction
public void commitTransaction() throws org.apache.kafka.common.errors.ProducerFencedException -
abortTransaction
public void abortTransaction() throws org.apache.kafka.common.errors.ProducerFencedException -
close
public void close() -
close
-
toString
-