Show / Hide Table of Contents

    Interface IConfluentProducerWrapper

    Wraps the underlying Confluent.Kafka.IProducer<TKey, TValue> and handles the connection lifecycle.

    Inherited Members
    IBrokerClient.ConnectAsync()
    IBrokerClient.DisconnectAsync()
    IBrokerClient.ReconnectAsync()
    IBrokerClient.Name
    IBrokerClient.DisplayName
    IBrokerClient.Initializing
    IBrokerClient.Initialized
    IBrokerClient.Disconnecting
    IBrokerClient.Disconnected
    IBrokerClient.Status
    IDisposable.Dispose()
    IAsyncDisposable.DisposeAsync()
    Namespace: Silverback.Messaging.Broker.Kafka
    Assembly: Silverback.Integration.Kafka.dll
    Syntax
    public interface IConfluentProducerWrapper : IBrokerClient, IDisposable, IAsyncDisposable

    Properties

    Configuration

    Gets the producer configuration.

    Declaration
    KafkaProducerConfiguration Configuration { get; }
    Property Value
    Type Description
    KafkaProducerConfiguration

    Methods

    AbortTransaction()

    Aborts the pending transaction.

    Declaration
    void AbortTransaction()

    BeginTransaction()

    Begins a new transaction.

    Declaration
    void BeginTransaction()

    CommitTransaction()

    Commits the pending transaction.

    Declaration
    void CommitTransaction()

    InitTransactions()

    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
    void InitTransactions()

    Produce(TopicPartition, Message<byte[]?, byte[]?>, Action<DeliveryReport<byte[]?, byte[]?>>)

    Produces the specified message to the specified topic and partition.

    Declaration
    void Produce(TopicPartition topicPartition, Message<byte[]?, byte[]?> message, Action<DeliveryReport<byte[]?, byte[]?>> deliveryHandler)
    Parameters
    Type Name Description
    TopicPartition topicPartition

    The target topic and partition.

    Message<byte[], byte[]> message

    The message.

    Action<DeliveryReport<byte[], byte[]>> deliveryHandler

    The Confluent.Kafka.DeliveryReport<TKey, TValue> handler.

    ProduceAsync(TopicPartition, Message<byte[]?, byte[]?>, CancellationToken)

    Produces the specified message to the specified topic and partition.

    Declaration
    Task<DeliveryResult<byte[]?, byte[]?>> ProduceAsync(TopicPartition topicPartition, Message<byte[]?, byte[]?> message, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TopicPartition topicPartition

    The target topic and partition.

    Message<byte[], byte[]> message

    The message.

    CancellationToken cancellationToken

    The cancellation token that can be used to cancel the operation.

    Returns
    Type Description
    Task<DeliveryResult<byte[], byte[]>>

    A Task<TResult> representing the asynchronous operation. The task result contains the Confluent.Kafka.DeliveryResult<TKey, TValue>.

    SendOffsetsToTransaction(IReadOnlyCollection<TopicPartitionOffset>, IConsumerGroupMetadata)

    Sends the consumed offsets to the transaction.

    Declaration
    void SendOffsetsToTransaction(IReadOnlyCollection<TopicPartitionOffset> offsets, IConsumerGroupMetadata groupMetadata)
    Parameters
    Type Name Description
    IReadOnlyCollection<TopicPartitionOffset> offsets

    The offsets to send.

    IConsumerGroupMetadata groupMetadata

    The consumer group metadata.

    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini