Class Broker<TProducerEndpoint, TConsumerEndpoint>
The base class for all IBroker implementations.
Inheritance
System.Object
Broker<TProducerEndpoint, TConsumerEndpoint>
Implements
System.IDisposable
Inherited Members
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()
Assembly: Silverback.Integration.dll
Syntax
public abstract class Broker<TProducerEndpoint, TConsumerEndpoint> : IBroker, IDisposable where TProducerEndpoint : IProducerEndpoint where TConsumerEndpoint : IConsumerEndpoint
Type Parameters
Name |
Description |
TProducerEndpoint |
The type of the IProducerEndpoint that is being handled by this broker
implementation.
|
TConsumerEndpoint |
The type of the IConsumerEndpoint that is being handled by this broker
implementation.
|
Constructors
|
Improve this doc
View source
Broker(IServiceProvider)
Declaration
protected Broker(IServiceProvider serviceProvider)
Parameters
Type |
Name |
Description |
System.IServiceProvider |
serviceProvider |
The System.IServiceProvider to be used to resolve the required services.
|
Properties
|
Improve this doc
View source
ConsumerEndpointType
Declaration
public Type ConsumerEndpointType { get; }
Property Value
Type |
Description |
System.Type |
|
|
Improve this doc
View source
Consumers
Declaration
public IReadOnlyList<IConsumer> Consumers { get; }
Property Value
Type |
Description |
System.Collections.Generic.IReadOnlyList<IConsumer> |
|
|
Improve this doc
View source
IsConnected
Declaration
public bool IsConnected { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this doc
View source
ProducerEndpointType
Declaration
public Type ProducerEndpointType { get; }
Property Value
Type |
Description |
System.Type |
|
|
Improve this doc
View source
Producers
Declaration
public IReadOnlyList<IProducer> Producers { get; }
Property Value
Type |
Description |
System.Collections.Generic.IReadOnlyList<IProducer> |
|
Methods
|
Improve this doc
View source
AddConsumer(IConsumerEndpoint)
Declaration
public virtual IConsumer AddConsumer(IConsumerEndpoint endpoint)
Parameters
Returns
|
Improve this doc
View source
ConnectAsync()
Declaration
public async Task ConnectAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this doc
View source
ConnectAsync(IReadOnlyCollection<IProducer>, IReadOnlyCollection<IConsumer>)
Connects all the consumers and starts consuming.
Declaration
protected virtual async Task ConnectAsync(IReadOnlyCollection<IProducer> producers, IReadOnlyCollection<IConsumer> consumers)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IReadOnlyCollection<IProducer> |
producers |
The producers to be connected.
|
System.Collections.Generic.IReadOnlyCollection<IConsumer> |
consumers |
The consumers to be connected and started.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
A System.Threading.Tasks.Task representing the asynchronous operation.
|
|
Improve this doc
View source
DisconnectAsync()
Declaration
public async Task DisconnectAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
|
Improve this doc
View source
DisconnectAsync(IReadOnlyCollection<IProducer>, IReadOnlyCollection<IConsumer>)
Disconnects all the consumers and stops consuming.
Declaration
protected virtual async Task DisconnectAsync(IReadOnlyCollection<IProducer> producers, IReadOnlyCollection<IConsumer> consumers)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IReadOnlyCollection<IProducer> |
producers |
The producers to be disconnected.
|
System.Collections.Generic.IReadOnlyCollection<IConsumer> |
consumers |
The consumers to be stopped and disconnected.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
A System.Threading.Tasks.Task representing the asynchronous operation.
|
|
Improve this doc
View source
Dispose()
Declaration
|
Improve this doc
View source
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged
resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
A value indicating whether the method has been called by the Dispose method and not from the
finalizer.
|
|
Improve this doc
View source
GetProducer(IProducerEndpoint)
Declaration
public virtual IProducer GetProducer(IProducerEndpoint endpoint)
Parameters
Returns
|
Improve this doc
View source
GetProducer(String)
Declaration
public virtual IProducer GetProducer(string endpointName)
Parameters
Type |
Name |
Description |
System.String |
endpointName |
|
Returns
|
Improve this doc
View source
InstantiateConsumer(TConsumerEndpoint, IBrokerBehaviorsProvider<IConsumerBehavior>, IServiceProvider)
Returns a new instance of IConsumer to subscribe to the specified endpoint.
Declaration
protected abstract IConsumer InstantiateConsumer(TConsumerEndpoint endpoint, IBrokerBehaviorsProvider<IConsumerBehavior> behaviorsProvider, IServiceProvider serviceProvider)
Parameters
Returns
|
Improve this doc
View source
InstantiateProducer(TProducerEndpoint, IBrokerBehaviorsProvider<IProducerBehavior>, IServiceProvider)
Returns a new instance of IProducer to publish to the specified endpoint. The
returned instance will be cached and reused for the same endpoint.
Declaration
protected abstract IProducer InstantiateProducer(TProducerEndpoint endpoint, IBrokerBehaviorsProvider<IProducerBehavior> behaviorsProvider, IServiceProvider serviceProvider)
Parameters
Returns
Implements
System.IDisposable