Class TransactionalProducerWrapper<K,V>

java.lang.Object
ru.tinkoff.kora.kafka.common.producer.TransactionalProducerWrapper<K,V>
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.clients.producer.Producer<K,V>

public class TransactionalProducerWrapper<K,V> extends Object implements org.apache.kafka.clients.producer.Producer<K,V>
  • Constructor Details

    • TransactionalProducerWrapper

      public TransactionalProducerWrapper(TransactionalProducerImpl<K,V> pool, ru.tinkoff.kora.kafka.common.producer.TransactionalProducerImpl.ProducerWithTelemetry<K,V> producerWithTelemetry)
  • Method Details

    • initTransactions

      public void initTransactions()
      Specified by:
      initTransactions in interface org.apache.kafka.clients.producer.Producer<K,V>
    • beginTransaction

      public void beginTransaction() throws org.apache.kafka.common.errors.ProducerFencedException
      Specified by:
      beginTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>
      Throws:
      org.apache.kafka.common.errors.ProducerFencedException
    • sendOffsetsToTransaction

      @Deprecated public void sendOffsetsToTransaction(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets, String consumerGroupId) throws org.apache.kafka.common.errors.ProducerFencedException
      Deprecated.
      Specified by:
      sendOffsetsToTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>
      Throws:
      org.apache.kafka.common.errors.ProducerFencedException
    • 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
      Specified by:
      sendOffsetsToTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>
      Throws:
      org.apache.kafka.common.errors.ProducerFencedException
    • commitTransaction

      public void commitTransaction() throws org.apache.kafka.common.errors.ProducerFencedException
      Specified by:
      commitTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>
      Throws:
      org.apache.kafka.common.errors.ProducerFencedException
    • abortTransaction

      public void abortTransaction() throws org.apache.kafka.common.errors.ProducerFencedException
      Specified by:
      abortTransaction in interface org.apache.kafka.clients.producer.Producer<K,V>
      Throws:
      org.apache.kafka.common.errors.ProducerFencedException
    • send

      public Future<org.apache.kafka.clients.producer.RecordMetadata> send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record)
      Specified by:
      send in interface org.apache.kafka.clients.producer.Producer<K,V>
    • send

      public Future<org.apache.kafka.clients.producer.RecordMetadata> send(org.apache.kafka.clients.producer.ProducerRecord<K,V> record, org.apache.kafka.clients.producer.Callback callback)
      Specified by:
      send in interface org.apache.kafka.clients.producer.Producer<K,V>
    • flush

      public void flush()
      Specified by:
      flush in interface org.apache.kafka.clients.producer.Producer<K,V>
    • partitionsFor

      public List<org.apache.kafka.common.PartitionInfo> partitionsFor(String topic)
      Specified by:
      partitionsFor in interface org.apache.kafka.clients.producer.Producer<K,V>
    • metrics

      public Map<org.apache.kafka.common.MetricName,? extends org.apache.kafka.common.Metric> metrics()
      Specified by:
      metrics in interface org.apache.kafka.clients.producer.Producer<K,V>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.kafka.clients.producer.Producer<K,V>
    • close

      public void close(Duration timeout)
      Specified by:
      close in interface org.apache.kafka.clients.producer.Producer<K,V>