Class RabbitConsumer
Consumes an endpoint and invokes a callback delegate when a message is received.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.RabbitMQ.dll
Syntax
public class RabbitConsumer : Consumer<RabbitBroker, RabbitConsumerEndpoint, RabbitDeliveryTag>, IConsumer, IDisposable
Constructors
| Improve this doc View sourceRabbitConsumer(RabbitBroker, RabbitConsumerEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider, IInboundLogger<RabbitConsumer>)
Initializes a new instance of the Rabbit
Declaration
public RabbitConsumer(RabbitBroker broker, RabbitConsumerEndpoint endpoint, IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider, IServiceProvider serviceProvider, IInboundLogger<RabbitConsumer> logger)
Parameters
Type | Name | Description |
---|---|---|
Rabbit |
broker | The IBroker that is instantiating the consumer. |
Rabbit |
endpoint | The endpoint to be consumed. |
IBroker |
behaviorsProvider | |
IService |
serviceProvider | The IService |
IInbound |
logger |
Methods
| Improve this doc View sourceCommitCoreAsync(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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be committed. |
Returns
Overrides
| Improve this doc View sourceConnectCoreAsync()
Connects to the message broker.
Declaration
protected override Task ConnectCoreAsync()
Returns
Overrides
| Improve this doc View sourceDisconnectCoreAsync()
Disconnects from the message broker.
Declaration
protected override Task DisconnectCoreAsync()
Returns
Overrides
| Improve this doc View sourceGetCurrentSequenceStores()
Gets the ISequenceKafkaConsumer
will create a store per each assigned partition).
Declaration
public override IReadOnlyList<ISequenceStore> GetCurrentSequenceStores()
Returns
Type | Description |
---|---|
IRead |
The list of ISequence |
Overrides
Remarks
Used only for testing and maintained to preserve backward compatibility.
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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be rolled back. |
Returns
Overrides
| Improve this doc View sourceStartCoreAsync()
Stops consuming while staying connected to the message broker.
Declaration
protected override Task StartCoreAsync()
Returns
Overrides
| Improve this doc View sourceStopCoreAsync()
Stops consuming while staying connected to the message broker.
Declaration
protected override Task StopCoreAsync()
Returns
Overrides
| Improve this doc View sourceWaitUntilConsumingStoppedCoreAsync()
Waits until the consuming is stopped.
Declaration
protected override Task WaitUntilConsumingStoppedCoreAsync()