Package io.micronaut.configuration.kafka
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 TypeMethodDescriptionvoidClosed 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 typeV- The value generic type- Parameters:
clientId- The client id of the producer.transactionalId- The transactional id of the producer.keyType- The key typevalueType- The value type- Returns:
- The producer
-
close
Closed the producer. Should be used for cases whenProducerFencedExceptionis thrown.- Parameters:
producer- The producer
-