Show / Hide Table of Contents

    Class RabbitConsumer

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

    Inheritance
    object
    Consumer
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>
    RabbitConsumer
    Implements
    IConsumer
    IDisposable
    Inherited Members
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.Broker
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.Endpoint
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.CommitCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.RollbackCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
    Consumer.Id
    Consumer.Broker
    Consumer.Endpoint
    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.CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer.RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    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.RabbitMQ.dll
    Syntax
    public class RabbitConsumer : Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>, IConsumer, IDisposable

    Constructors

    | Improve this doc View source

    RabbitConsumer(RabbitBroker, RabbitConsumerEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider, IInboundLogger<RabbitConsumer>)

    Initializes a new instance of the RabbitConsumer class.

    Declaration
    public RabbitConsumer(RabbitBroker broker, RabbitConsumerEndpoint endpoint, IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IInboundLogger<RabbitConsumer> logger)
    Parameters
    Type Name Description
    RabbitBroker broker

    The IBroker that is instantiating the consumer.

    RabbitConsumerEndpoint 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<RabbitConsumer> logger

    The IInboundLogger<TCategoryName>.

    Methods

    | Improve this doc View source

    CommitCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)

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

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

    The identifiers of to message be committed.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.CommitCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
    | Improve this doc View source

    ConnectCoreAsync()

    Connects to the message broker.

    Declaration
    protected override Task ConnectCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.ConnectCoreAsync()
    | Improve this doc View source

    DisconnectCoreAsync()

    Disconnects from the message broker.

    Declaration
    protected override Task DisconnectCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.DisconnectCoreAsync()
    | Improve this doc View source

    GetCurrentSequenceStores()

    Gets the ISequenceStore instances used by this consumer. Some brokers will require multiple stores (e.g. the KafkaConsumer will create a store per each assigned partition).

    Declaration
    public override IReadOnlyList<ISequenceStore> GetCurrentSequenceStores()
    Returns
    Type Description
    IReadOnlyList<ISequenceStore>

    The list of ISequenceStore.

    Overrides
    Consumer.GetCurrentSequenceStores()
    Remarks

    Used only for testing and maintained to preserve backward compatibility.

    | Improve this doc View source

    RollbackCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)

    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<RabbitDeliveryTag> brokerMessageIdentifiers)
    Parameters
    Type Name Description
    IReadOnlyCollection<RabbitDeliveryTag> brokerMessageIdentifiers

    The identifiers of to message be rolled back.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>.RollbackCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
    | Improve this doc View source

    StartCoreAsync()

    Stops consuming while staying connected to the message broker.

    Declaration
    protected override Task StartCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.StartCoreAsync()
    | Improve this doc View source

    StopCoreAsync()

    Stops consuming while staying connected to the message broker.

    Declaration
    protected override Task StopCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.StopCoreAsync()
    | Improve this doc View source

    WaitUntilConsumingStoppedCoreAsync()

    Waits until the consuming is stopped.

    Declaration
    protected override Task WaitUntilConsumingStoppedCoreAsync()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer.WaitUntilConsumingStoppedCoreAsync()

    Implements

    IConsumer
    IDisposable
    • Improve this doc
    • View source
    In this article
    • Constructors
      • RabbitConsumer(RabbitBroker, RabbitConsumerEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider, IInboundLogger<RabbitConsumer>)
    • Methods
      • CommitCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
      • ConnectCoreAsync()
      • DisconnectCoreAsync()
      • GetCurrentSequenceStores()
      • RollbackCoreAsync(IReadOnlyCollection<RabbitDeliveryTag>)
      • StartCoreAsync()
      • StopCoreAsync()
      • WaitUntilConsumingStoppedCoreAsync()
    • Implements
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini