Class TransactionalPublisherImpl<P extends GeneratedPublisher>
java.lang.Object
ru.tinkoff.kora.kafka.common.producer.TransactionalPublisherImpl<P>
- All Implemented Interfaces:
ru.tinkoff.kora.application.graph.Lifecycle,TransactionalPublisher<P>
public final class TransactionalPublisherImpl<P extends GeneratedPublisher>
extends Object
implements TransactionalPublisher<P>, ru.tinkoff.kora.application.graph.Lifecycle
-
Nested Class Summary
Nested classes/interfaces inherited from interface ru.tinkoff.kora.kafka.common.producer.TransactionalPublisher
TransactionalPublisher.Transaction<P>, TransactionalPublisher.TransactionalConsumer<P,E extends Throwable>, TransactionalPublisher.TransactionalFunction<P, E extends Throwable, R>, TransactionalPublisher.TransactionConsumer<P, E extends Throwable>, TransactionalPublisher.TransactionFunction<P, E extends Throwable, R> -
Constructor Summary
ConstructorsConstructorDescriptionTransactionalPublisherImpl(KafkaPublisherConfig.TransactionConfig config, Supplier<? extends P> factory) -
Method Summary
Modifier and TypeMethodDescriptionbegin()Initialize Publisher in transaction modeProducer.initTransactions()and then begins transactionProducer.beginTransaction()and returns publisher in such statefinal voiddeleteFromPool(P p) voidinit()voidrelease()final voidreturnToPool(P p) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ru.tinkoff.kora.kafka.common.producer.TransactionalPublisher
inTx, inTx, withTx, withTx
-
Constructor Details
-
TransactionalPublisherImpl
public TransactionalPublisherImpl(KafkaPublisherConfig.TransactionConfig config, Supplier<? extends P> factory)
-
-
Method Details
-
begin
Description copied from interface:TransactionalPublisherInitialize Publisher in transaction modeProducer.initTransactions()and then begins transactionProducer.beginTransaction()and returns publisher in such state- Specified by:
beginin interfaceTransactionalPublisher<P extends GeneratedPublisher>- Returns:
- Publisher as
TransactionalPublisherIt is expected that you will manually call
Producer.commitTransaction()orProducer.abortTransaction()and thenProducer.close()
-
returnToPool
-
deleteFromPool
-
init
public void init()- Specified by:
initin interfaceru.tinkoff.kora.application.graph.Lifecycle
-
release
- Specified by:
releasein interfaceru.tinkoff.kora.application.graph.Lifecycle- Throws:
Exception
-