Class Consumer<TBroker, TEndpoint, TIdentifier>
Consumes an endpoint and invokes a callback delegate when a message is received.
Inheritance
Inherited Members
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 IConsumer |
TIdentifier | The type of the IBroker |
Constructors
| Improve this doc View sourceConsumer(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. |
IBroker |
behaviorsProvider | |
IService |
serviceProvider | The IService |
IInbound |
logger |
Properties
| Improve this doc View sourceBroker
Gets the IBroker that owns this consumer.
Declaration
public TBroker Broker { get; }
Property Value
Type | Description |
---|---|
TBroker |
Endpoint
Gets the IConsumer
Declaration
public TEndpoint Endpoint { get; }
Property Value
Type | Description |
---|---|
TEndpoint |
Methods
| Improve this doc View sourceCommitCoreAsync(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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be committed. |
Returns
Overrides
| Improve this doc View sourceCommitCoreAsync(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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be committed. |
Returns
| Improve this doc View sourceRollbackCoreAsync(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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be rolled back. |
Returns
Overrides
| Improve this doc View sourceRollbackCoreAsync(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 |
---|---|---|
IRead |
brokerMessageIdentifiers | The identifiers of to message be rolled back. |