Interface IBroker
The basic interface to interact with the message broker.
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.dll
Syntax
public interface IBroker
Properties
| Improve this doc View sourceConsumerEndpointType
Gets the type of the IConsumerEndpoint that is being handled by this broker implementation.
Declaration
Type ConsumerEndpointType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Consumers
Gets the collection of IConsumer that have been created so far.
Declaration
IReadOnlyList<IConsumer> Consumers { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IConsumer> |
IsConnected
Gets a value indicating whether this broker is currently connected.
Declaration
bool IsConnected { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ProducerEndpointType
Gets the type of the IProducerEndpoint that is being handled by this broker implementation.
Declaration
Type ProducerEndpointType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Producers
Gets the collection of IProducer that have been created so far.
Declaration
IReadOnlyList<IProducer> Producers { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IProducer> |
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
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 the message broker to start consuming.
Declaration
Task ConnectAsync()
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
DisconnectAsync()
Disconnect from the message broker to stop consuming.
Declaration
Task DisconnectAsync()
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
GetProducer(IProducerEndpoint)
Returns an IProducer to be used to produce to the specified endpoint.
Declaration
IProducer GetProducer(IProducerEndpoint endpoint)
Parameters
| Type | Name | Description |
|---|---|---|
| IProducerEndpoint | endpoint | The target endpoint. |
Returns
| Type | Description |
|---|---|
| IProducer | The IProducer for the specified endpoint. |
GetProducer(string)
Returns an IProducer to be used to produce to the specified endpoint.
Declaration
IProducer GetProducer(string endpointName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | endpointName | The target endpoint name (or friendly name). |
Returns
| Type | Description |
|---|---|
| IProducer | The IProducer for the specified endpoint. |