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:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.kafka.clients.producer.Producer<K,V>
- Enclosing class:
- DefaultKafkaProducerFactory<K,V>
protected static class DefaultKafkaProducerFactory.CloseSafeProducer<K,V> extends java.lang.Object implements org.apache.kafka.clients.producer.Producer<K,V>
A wrapper class for the delegate.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortTransaction()
void
beginTransaction()
void
close()
void
close(java.time.Duration timeout)
void
commitTransaction()
void
flush()
void
initTransactions()
java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric>
metrics()
java.util.List<org.apache.kafka.common.PartitionInfo>
partitionsFor(java.lang.String topic)
java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata>
send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
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)
void
sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, java.lang.String consumerGroupId)
void
sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, org.apache.kafka.clients.consumer.ConsumerGroupMetadata groupMetadata)
java.lang.String
toString()
-
-
-
Method Detail
-
send
public java.util.concurrent.Future<org.apache.kafka.clients.producer.RecordMetadata> send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
-
send
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)
-
flush
public void flush()
-
partitionsFor
public java.util.List<org.apache.kafka.common.PartitionInfo> partitionsFor(java.lang.String topic)
-
metrics
public java.util.Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics()
-
initTransactions
public void initTransactions()
-
beginTransaction
public void beginTransaction() throws org.apache.kafka.common.errors.ProducerFencedException
-
sendOffsetsToTransaction
public void sendOffsetsToTransaction(java.util.Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, java.lang.String consumerGroupId) throws org.apache.kafka.common.errors.ProducerFencedException
-
sendOffsetsToTransaction
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
-
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
public void close(@Nullable java.time.Duration timeout)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-