Show / Hide Table of Contents

    Class MqttConsumer

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

    Inheritance
    object
    Consumer
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>
    MqttConsumer
    Implements
    IConsumer
    IDisposable
    Inherited Members
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.Broker
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.Endpoint
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.CommitCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.RollbackCoreAsync(IReadOnlyCollection<IBrokerMessageIdentifier>)
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.CommitCoreAsync(IReadOnlyCollection<MqttMessageIdentifier>)
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.RollbackCoreAsync(IReadOnlyCollection<MqttMessageIdentifier>)
    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()
    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.MQTT.dll
    Syntax
    public class MqttConsumer : Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>, IConsumer, IDisposable

    Constructors

    | Improve this doc View source

    MqttConsumer(MqttBroker, MqttConsumerEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider, IInboundLogger<MqttConsumer>)

    Initializes a new instance of the MqttConsumer class.

    Declaration
    public MqttConsumer(MqttBroker broker, MqttConsumerEndpoint endpoint, IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IInboundLogger<MqttConsumer> logger)
    Parameters
    Type Name Description
    MqttBroker broker

    The IBroker that is instantiating the consumer.

    MqttConsumerEndpoint 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<MqttConsumer> logger

    The IInboundLogger<TCategoryName>.

    Methods

    | Improve this doc View source

    CommitCoreAsync(IReadOnlyCollection<MqttMessageIdentifier>)

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

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

    The identifiers of to message be committed.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.CommitCoreAsync(IReadOnlyCollection<MqttMessageIdentifier>)
    | 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

    Dispose(bool)

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    A value indicating whether the method has been called by the Dispose method and not from the finalizer.

    Overrides
    Consumer.Dispose(bool)
    | 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<MqttMessageIdentifier>)

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

    The identifiers of to message be rolled back.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    Consumer<MqttBroker, MqttConsumerEndpoint, MqttMessageIdentifier>.RollbackCoreAsync(IReadOnlyCollection<MqttMessageIdentifier>)
    | Improve this doc View source

    StartCoreAsync()

    Starts consuming. Called to resume consuming after StopAsync() has been called.

    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
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini