Interface IRabbitMqManagementClient
Client for interacting with the RabbitMQ Management HTTP API.
public interface IRabbitMqManagementClient : IAsyncDisposable
- Inherited Members
- Extension Methods
Remarks
Provides read and operational access to the RabbitMQ Management plugin's HTTP API for monitoring queue states, exchange configurations, connection details, and performing administrative operations such as queue purging.
This interface follows the Microsoft pattern of keeping interface surface area minimal (5 methods). Additional management operations can be added via extension methods or the GetService(Type) escape hatch for direct HTTP access.
Methods
GetConnectionInfoAsync(string, CancellationToken)
Gets information about a specific connection.
Task<ConnectionInfo> GetConnectionInfoAsync(string connectionName, CancellationToken cancellationToken)
Parameters
connectionNamestringThe name of the connection.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<ConnectionInfo>
A Task<TResult> representing the asynchronous operation, containing the ConnectionInfo.
Exceptions
- ArgumentNullException
Thrown when
connectionNameis null.
GetExchangeInfoAsync(string, CancellationToken)
Gets information about a specific exchange.
Task<ExchangeInfo> GetExchangeInfoAsync(string exchangeName, CancellationToken cancellationToken)
Parameters
exchangeNamestringThe name of the exchange.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<ExchangeInfo>
A Task<TResult> representing the asynchronous operation, containing the ExchangeInfo.
Exceptions
- ArgumentNullException
Thrown when
exchangeNameis null.
GetOverviewAsync(CancellationToken)
Gets a high-level overview of the RabbitMQ broker.
Task<BrokerOverview> GetOverviewAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<BrokerOverview>
A Task<TResult> representing the asynchronous operation, containing the BrokerOverview.
GetQueueInfoAsync(string, CancellationToken)
Gets information about a specific queue.
Task<QueueInfo> GetQueueInfoAsync(string queueName, CancellationToken cancellationToken)
Parameters
queueNamestringThe name of the queue.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<QueueInfo>
A Task<TResult> representing the asynchronous operation, containing the QueueInfo.
Exceptions
- ArgumentNullException
Thrown when
queueNameis null.
PurgeQueueAsync(string, CancellationToken)
Purges all messages from the specified queue.
Task PurgeQueueAsync(string queueName, CancellationToken cancellationToken)
Parameters
queueNamestringThe name of the queue to purge.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Exceptions
- ArgumentNullException
Thrown when
queueNameis null.