AspireRabbitMQExtensions Methods
Class Methods 2 members
Extension methods for connecting to a RabbitMQ message broker.
AddKeyedRabbitMQClient(IHostApplicationBuilder, string, Action<RabbitMQClientSettings>, Action<ConnectionFactory>) Section titled AddKeyedRabbitMQClient(IHostApplicationBuilder, string, Action<RabbitMQClientSettings>, Action<ConnectionFactory>) extension Registers
Client.IConnection as a keyed singleton for the given name in the services provided by the builder. Enables retries, corresponding health check, logging, and telemetry. public static class AspireRabbitMQExtensions{ public static void AddKeyedRabbitMQClient( this IHostApplicationBuilder builder, string name, Action<RabbitMQClientSettings>? configureSettings = null, Action<ConnectionFactory>? configureConnectionFactory = null) { // ... }}Parameters
builder IHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to. name string The name of the component, which is used as the ServiceDescriptor.ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section. configureSettings Action<RabbitMQClientSettings> optional An optional method that can be used for customizing the RabbitMQClientSettings. It's invoked after the settings are read from the configuration. configureConnectionFactory Action<ConnectionFactory> optional An optional method that can be used for customizing the Client.ConnectionFactory. It's invoked after the options are read from the configuration. Remarks
Reads the configuration from "Aspire:RabbitMQ:Client:{name}" section.
AddRabbitMQClient(IHostApplicationBuilder, string, Action<RabbitMQClientSettings>, Action<ConnectionFactory>) Section titled AddRabbitMQClient(IHostApplicationBuilder, string, Action<RabbitMQClientSettings>, Action<ConnectionFactory>) extension Registers
Client.IConnection as a singleton in the services provided by the builder. Enables retries, corresponding health check, logging, and telemetry. public static class AspireRabbitMQExtensions{ public static void AddRabbitMQClient( this IHostApplicationBuilder builder, string connectionName, Action<RabbitMQClientSettings>? configureSettings = null, Action<ConnectionFactory>? configureConnectionFactory = null) { // ... }}Parameters
builder IHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to. connectionName string A name used to retrieve the connection string from the ConnectionStrings configuration section. configureSettings Action<RabbitMQClientSettings> optional An optional method that can be used for customizing the RabbitMQClientSettings. It's invoked after the settings are read from the configuration. configureConnectionFactory Action<ConnectionFactory> optional An optional method that can be used for customizing the Client.ConnectionFactory. It's invoked after the options are read from the configuration. Remarks
Reads the configuration from "Aspire:RabbitMQ:Client" section.