Class KafkaTransactionalProducer
Produces to an endpoint.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.Kafka.dll
Syntax
public class KafkaTransactionalProducer : KafkaProducer, IProducer, IDisposable
Constructors
| Improve this doc View sourceKafkaTransactionalProducer(KafkaBroker, KafkaProducerEndpoint, IBrokerBehaviorsProvider<IProducerBehavior>, IConfluentProducersCache, IServiceProvider, IOutboundLogger<KafkaProducer>)
Initializes a new instance of the KafkaTransactionalProducer class.
Declaration
public KafkaTransactionalProducer(KafkaBroker broker, KafkaProducerEndpoint endpoint, IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider, IConfluentProducersCache producersCache, IServiceProvider serviceProvider, IOutboundLogger<KafkaProducer> logger)
Parameters
Type | Name | Description |
---|---|---|
KafkaBroker | broker | The IBroker that instantiated this producer. |
KafkaProducerEndpoint | endpoint | The endpoint to produce to. |
IBrokerBehaviorsProvider<IProducerBehavior> | behaviorsProvider | |
IConfluentProducersCache | producersCache | |
IServiceProvider | serviceProvider | The IServiceProvider to be used to resolve the required services. |
IOutboundLogger<KafkaProducer> | logger |
Methods
| Improve this doc View sourceAbortTransaction()
Aborts the pending transaction.
Declaration
public void AbortTransaction()
BeginTransaction()
Begins a new transaction.
Declaration
public void BeginTransaction()
CommitTransaction()
Commits the pending transaction.
Declaration
public void CommitTransaction()
InitTransaction()
Initialize the transactions.
This function ensures any transactions initiated by previous instances of the producer with the same TransactionalId are completed. If the previous instance failed with a transaction in progress the previous transaction will be aborted.
This function needs to be called before any other transactional or produce functions are called when the TransactionalId is configured.
Declaration
public void InitTransaction()