Interface IBrokerClient
- Namespace
- Silverback.Messaging.Broker
- Assembly
- Silverback.Integration.dll
Wraps the underlying client libraries (e.g. Kafka consumers and producers or Mqtt clients) and handles the connection lifecycle.
public interface IBrokerClient : IDisposable, IAsyncDisposable
- Inherited Members
Properties
Disconnected
Gets the AsyncEvent<TArg> that is fired when the DisconnectAsync() method has been called and the client is disconnected.
AsyncEvent<BrokerClient> Disconnected { get; }
Property Value
Disconnecting
Gets the AsyncEvent<TArg> that is fired when the DisconnectAsync() method is called and the client is disconnecting.
AsyncEvent<BrokerClient> Disconnecting { get; }
Property Value
DisplayName
Gets the name to be displayed in the human-targeted output (e.g. logs, health checks result, etc.).
string DisplayName { get; }
Property Value
Initialized
Gets the AsyncEvent<TArg> that is fired when the ConnectAsync() method has been called and the client has been successfully initialized. The connection with the broker will eventually be established.
AsyncEvent<BrokerClient> Initialized { get; }
Property Value
Initializing
Gets the AsyncEvent<TArg> that is fired when the ConnectAsync() method is called and the client is initializing.
AsyncEvent<BrokerClient> Initializing { get; }
Property Value
Name
Gets the client name.
string Name { get; }
Property Value
Status
Gets a value indicating whether the client is connected to the broker.
ClientStatus Status { get; }
Property Value
Methods
ConnectAsync()
Initializes the connection to the message broker.
ValueTask ConnectAsync()
Returns
DisconnectAsync()
Disconnects from the message broker.
ValueTask DisconnectAsync()
Returns
ReconnectAsync()
Disconnects and reconnects the client.
ValueTask ReconnectAsync()
Returns
Remarks
This is used to recover when the consumer is stuck in state where it's not able to rollback or commit anymore.