Class BrokerConnectorService
Automatically connects the message brokers when the application starts and disconnects them when the application is being stopped.
Inheritance
System.Object
Microsoft.Extensions.Hosting.BackgroundService
BrokerConnectorService
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable
Inherited Members
Microsoft.Extensions.Hosting.BackgroundService.StartAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.StopAsync(System.Threading.CancellationToken)
Microsoft.Extensions.Hosting.BackgroundService.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.dll
Syntax
public class BrokerConnectorService : BackgroundService, IHostedService, IDisposable
Constructors
| Improve this doc View sourceBrokerConnectorService(IHostApplicationLifetime, IBrokerCollection, BrokerConnectionOptions, ISilverbackLogger<BrokerConnectorService>)
Initializes a new instance of the BrokerConnectorService class.
Declaration
public BrokerConnectorService(IHostApplicationLifetime applicationLifetime, IBrokerCollection brokersCollection, BrokerConnectionOptions connectionOptions, ISilverbackLogger<BrokerConnectorService> logger)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Hosting.IHostApplicationLifetime | applicationLifetime | The Microsoft.Extensions.Hosting.IHostApplicationLifetime. |
IBrokerCollection | brokersCollection | The IBrokerCollection. |
BrokerConnectionOptions | connectionOptions | |
ISilverbackLogger<BrokerConnectorService> | logger | The ISilverbackLogger. |
Methods
| Improve this doc View sourceExecuteAsync(CancellationToken)
Declaration
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | stoppingToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
Microsoft.Extensions.Hosting.BackgroundService.ExecuteAsync(System.Threading.CancellationToken)
Implements
Microsoft.Extensions.Hosting.IHostedService
System.IDisposable