Class BrokerCollection
Holds a reference to all the registered IBroker implementations and is able to resolve the right instance according to the IEndpoint type.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.dll
Syntax
public class BrokerCollection : IBrokerCollection, IReadOnlyList<IBroker>, IReadOnlyCollection<IBroker>, IEnumerable<IBroker>, IEnumerable
Constructors
| Improve this doc View sourceBrokerCollection(IEnumerable<IBroker>)
Initializes a new instance of the BrokerCollection class.
Declaration
public BrokerCollection(IEnumerable<IBroker> brokers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IBroker> | brokers | The brokers to be added to the collection. |
Properties
| Improve this doc View sourceCount
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
Declaration
public IBroker this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
IBroker |
Methods
| Improve this doc View sourceAddConsumer(IConsumerEndpoint)
Adds an IConsumer that will consume from the specified endpoint as soon as the broker is connected. The received messages will be forwarded to the specified callback delegate.
Declaration
public IConsumer AddConsumer(IConsumerEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
IConsumerEndpoint | endpoint | The source endpoint. |
Returns
Type | Description |
---|---|
IConsumer | The IConsumer for the specified endpoint. |
ConnectAsync()
Connect to all message brokers to start consuming.
Declaration
public Task ConnectAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
DisconnectAsync()
Disconnect from all message brokers to stop consuming.
Declaration
public Task DisconnectAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing the asynchronous operation. |
GetEnumerator()
Declaration
public IEnumerator<IBroker> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<IBroker> |
GetProducer(IProducerEndpoint)
Returns an IProducer to be used to produce to the specified endpoint.
Declaration
public IProducer GetProducer(IProducerEndpoint endpoint)
Parameters
Type | Name | Description |
---|---|---|
IProducerEndpoint | endpoint | The target endpoint. |
Returns
Type | Description |
---|---|
IProducer | The IProducer for the specified endpoint. |
Explicit Interface Implementations
| Improve this doc View sourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |