Show / Hide Table of Contents

    Class Consumer<TBroker, TEndpoint, TIdentifier>

    Consumes an endpoint and invokes a callback delegate when a message is received.

    Inheritance
    object
    Consumer
    Consumer<TBroker, TEndpoint, TIdentifier>
    KafkaConsumer
    MqttConsumer
    RabbitConsumer
    Implements
    IConsumer
    IDisposable
    Inherited Members
    Consumer.Id
    Consumer.StatusInfo
    Consumer.IsConnecting
    Consumer.IsConnected
    Consumer.IsConsuming
    Consumer.IsDisconnecting
    Consumer.ServiceProvider
    Consumer.IsStopping
    Consumer.ConnectAsync()
    Consumer.DisconnectAsync()
    Consumer.TriggerReconnectAsync()
    Consumer.StartAsync()
    Consumer.StopAsync()
    Consumer.CommitAsync(IBrokerMessageIdentifier)
    Consumer.CommitAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer.RollbackAsync(IBrokerMessageIdentifier)
    Consumer.RollbackAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer.IncrementFailedAttempts(IRawInboundEnvelope)
    Consumer.Dispose()
    Consumer.GetCurrentSequenceStores()
    Consumer.ConnectCoreAsync()
    Consumer.DisconnectCoreAsync()
    Consumer.StartCoreAsync()
    Consumer.StopCoreAsync()
    Consumer.WaitUntilConsumingStoppedCoreAsync()
    Consumer.HandleMessageAsync(byte[], IReadOnlyCollection<MessageHeader>, string, IBrokerMessageIdentifier, ISequenceStore)
    Consumer.SetReadyStatus()
    Consumer.RevertReadyStatus()
    Consumer.Dispose(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Broker
    Assembly: Silverback.Integration.dll
    Syntax
    public abstract class Consumer<TBroker, TEndpoint, TIdentifier> : Consumer, IConsumer, IDisposable where TBroker : IBroker where TEndpoint : IConsumerEndpoint where TIdentifier : IBrokerMessageIdentifier
    Type Parameters
    Name Description
    TBroker

    The type of the related IBroker implementation.

    TEndpoint

    The type of the IConsumerEndpoint implementation used by this consumer implementation.

    TIdentifier

    The type of the IBrokerMessageIdentifier used by this broker implementation.

    Constructors

    | Improve this doc View source

    Consumer(TBroker, TEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider, IInboundLogger<Consumer<TBroker, TEndpoint, TIdentifier>>)

    Initializes a new instance of the Consumer<TBroker, TEndpoint, TIdentifier> class.

    Declaration
    protected Consumer(TBroker broker, TEndpoint endpoint, IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IInboundLogger<Consumer<TBroker, TEndpoint, TIdentifier>> logger)
    Parameters
    Type Name Description
    TBroker broker

    The IBroker that is instantiating the consumer.

    TEndpoint endpoint

    The endpoint to be consumed.

    IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider

    The IBrokerBehaviorsProvider<TBehavior>.

    IServiceProvider serviceProvider

    The IServiceProvider to be used to resolve the needed services.

    IInboundLogger<Consumer<TBroker, TEndpoint, TIdentifier>> logger

    The IInboundLogger<TCategoryName>.

    Properties

    | Improve this doc View source

    Broker

    Gets the IBroker that owns this consumer.

    Declaration
    public TBroker Broker { get; }
    Property Value
    Type Description
    TBroker
    | Improve this doc View source

    Endpoint

    Gets the IConsumerEndpoint representing the endpoint that is being consumed.

    Declaration
    public TEndpoint Endpoint { get; }
    Property Value
    Type Description
    TEndpoint

    Methods

    | Improve this doc View source

    CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)

    Commits the specified messages sending the acknowledgement to the message broker.

    Declaration
    protected override Task CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier> brokerMessageIdentifiers)
    Parameters
    Type Name Description
    IReadOnlyCollection<IBrokerMessageIdentifier> brokerMessageIdentifiers

    The identifiers of to message be committed.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    | Improve this doc View source

    CommitCoreAsync(IReadOnlyCollection<TIdentifier>)

    Commits the specified messages sending the acknowledgement to the message broker.

    Declaration
    protected abstract Task CommitCoreAsync(IReadOnlyCollection<TIdentifier> brokerMessageIdentifiers)
    Parameters
    Type Name Description
    IReadOnlyCollection<TIdentifier> brokerMessageIdentifiers

    The identifiers of to message be committed.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    | Improve this doc View source

    RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)

    If necessary notifies the message broker that the specified messages couldn't be processed successfully, to ensure that they will be consumed again.

    Declaration
    protected override Task RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier> brokerMessageIdentifiers)
    Parameters
    Type Name Description
    IReadOnlyCollection<IBrokerMessageIdentifier> brokerMessageIdentifiers

    The identifiers of to message be rolled back.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    | Improve this doc View source

    RollbackCoreAsync(IReadOnlyCollection<TIdentifier>)

    If necessary notifies the message broker that the specified messages couldn't be processed successfully, to ensure that they will be consumed again.

    Declaration
    protected abstract Task RollbackCoreAsync(IReadOnlyCollection<TIdentifier> brokerMessageIdentifiers)
    Parameters
    Type Name Description
    IReadOnlyCollection<TIdentifier> brokerMessageIdentifiers

    The identifiers of to message be rolled back.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Implements

    IConsumer
    IDisposable
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini