Interface TransactionalProducerRegistry

All Known Implementing Classes:
KafkaProducerFactory

public interface TransactionalProducerRegistry
A registry of managed transactional Producer instances key by id and type. The producer instance returned will have transactions initialized by executing Producer.initTransactions().
Since:
4.1.0
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close(@NonNull Producer<?,?> producer)
    Closed the producer.
    <K, V> @NonNull Producer<K,V>
    getTransactionalProducer(@Nullable String clientId, String transactionalId, io.micronaut.core.type.Argument<K> keyType, io.micronaut.core.type.Argument<V> valueType)
    Returns a transactional managed Producer.
  • Method Details

    • getTransactionalProducer

      @NonNull <K, V> @NonNull Producer<K,V> getTransactionalProducer(@Nullable @Nullable String clientId, String transactionalId, io.micronaut.core.type.Argument<K> keyType, io.micronaut.core.type.Argument<V> valueType)
      Returns a transactional managed Producer.
      Type Parameters:
      K - The key generic type
      V - The value generic type
      Parameters:
      clientId - The client id of the producer.
      transactionalId - The transactional id of the producer.
      keyType - The key type
      valueType - The value type
      Returns:
      The producer
    • close

      void close(@NonNull @NonNull Producer<?,?> producer)
      Closed the producer. Should be used for cases when ProducerFencedException is thrown.
      Parameters:
      producer - The producer