Show / Hide Table of Contents

    Interface IMockedConfluentConsumer

    A mocked implementation of Confluent.Kafka.IConsumer<TKey, TValue> from Confluent.Kafka that consumes from an IInMemoryTopic.

    Inherited Members
    IConsumer<byte[], byte[]>.Consume(int)
    IConsumer<byte[], byte[]>.Consume(CancellationToken)
    IConsumer<byte[], byte[]>.Consume(TimeSpan)
    IConsumer<byte[], byte[]>.Subscribe(IEnumerable<string>)
    IConsumer<byte[], byte[]>.Subscribe(string)
    IConsumer<byte[], byte[]>.Unsubscribe()
    IConsumer<byte[], byte[]>.Assign(TopicPartition)
    IConsumer<byte[], byte[]>.Assign(TopicPartitionOffset)
    IConsumer<byte[], byte[]>.Assign(IEnumerable<TopicPartitionOffset>)
    IConsumer<byte[], byte[]>.Assign(IEnumerable<TopicPartition>)
    IConsumer<byte[], byte[]>.IncrementalAssign(IEnumerable<TopicPartitionOffset>)
    IConsumer<byte[], byte[]>.IncrementalAssign(IEnumerable<TopicPartition>)
    IConsumer<byte[], byte[]>.IncrementalUnassign(IEnumerable<TopicPartition>)
    IConsumer<byte[], byte[]>.Unassign()
    IConsumer<byte[], byte[]>.StoreOffset(ConsumeResult<byte[], byte[]>)
    IConsumer<byte[], byte[]>.StoreOffset(TopicPartitionOffset)
    IConsumer<byte[], byte[]>.Commit()
    IConsumer<byte[], byte[]>.Commit(IEnumerable<TopicPartitionOffset>)
    IConsumer<byte[], byte[]>.Commit(ConsumeResult<byte[], byte[]>)
    IConsumer<byte[], byte[]>.Seek(TopicPartitionOffset)
    IConsumer<byte[], byte[]>.Pause(IEnumerable<TopicPartition>)
    IConsumer<byte[], byte[]>.Resume(IEnumerable<TopicPartition>)
    IConsumer<byte[], byte[]>.Committed(TimeSpan)
    IConsumer<byte[], byte[]>.Committed(IEnumerable<TopicPartition>, TimeSpan)
    IConsumer<byte[], byte[]>.Position(TopicPartition)
    IConsumer<byte[], byte[]>.OffsetsForTimes(IEnumerable<TopicPartitionTimestamp>, TimeSpan)
    IConsumer<byte[], byte[]>.GetWatermarkOffsets(TopicPartition)
    IConsumer<byte[], byte[]>.QueryWatermarkOffsets(TopicPartition, TimeSpan)
    IConsumer<byte[], byte[]>.Close()
    IConsumer<byte[], byte[]>.MemberId
    IConsumer<byte[], byte[]>.Assignment
    IConsumer<byte[], byte[]>.Subscription
    IConsumer<byte[], byte[]>.ConsumerGroupMetadata
    IClient.AddBrokers(string)
    IClient.SetSaslCredentials(string, string)
    IClient.Handle
    IClient.Name
    IDisposable.Dispose()
    Namespace: Silverback.Messaging.Broker.Kafka.Mocks
    Assembly: Silverback.Integration.Kafka.Testing.dll
    Syntax
    public interface IMockedConfluentConsumer : IConsumer<byte[]?, byte[]?>, IClient, IDisposable

    Properties

    Config

    Gets the Confluent.Kafka.ConsumerConfig.

    Declaration
    ConsumerConfig Config { get; }
    Property Value
    Type Description
    ConsumerConfig

    IsDisposed

    Gets a value indicating whether this instance was disposed.

    Declaration
    bool IsDisposed { get; }
    Property Value
    Type Description
    bool

    PartitionsAssigned

    Gets a value indicating whether the partitions have been assigned to the consumer, either manually or via rebalance.

    Declaration
    bool PartitionsAssigned { get; }
    Property Value
    Type Description
    bool
    Remarks

    This value indicates that the rebalance process is over. It could be that no partition has actually been assigned.

    Methods

    GetStoredOffset(TopicPartition)

    Gets the stored offset for the specified topic partition.

    Declaration
    TopicPartitionOffset GetStoredOffset(TopicPartition topicPartition)
    Parameters
    Type Name Description
    TopicPartition topicPartition

    The topic partition.

    Returns
    Type Description
    TopicPartitionOffset

    The Confluent.Kafka.TopicPartitionOffset representing the offset, or Confluent.Kafka.Offset.Unset if the specified topic partition isn't currently assigned to the consumer or no offset has been stored so far.

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