Skip to content
Docs Try Aspire

AspireEventHubsExtensions Methods

Class Methods 10 members
Provides extension methods for registering Event Hubs clients in the services provided by the Hosting.IHostApplicationBuilder.
AddAzureEventHubBufferedProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsBufferedProducerSettings>, Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>) Section titled AddAzureEventHubBufferedProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsBufferedProducerSettings>, Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>) extension
Registers Producer.EventHubBufferedProducerClient as a singleton in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddAzureEventHubBufferedProducerClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingEventHubsBufferedProducerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsBufferedProducerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsBufferedProducerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddAzureEventHubConsumerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsConsumerSettings>, Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>) Section titled AddAzureEventHubConsumerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsConsumerSettings>, Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>) extension
Registers Consumer.EventHubConsumerClient as a singleton in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddAzureEventHubConsumerClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingEventHubsConsumerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsConsumerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsConsumerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddAzureEventHubProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProducerSettings>, Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>) Section titled AddAzureEventHubProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProducerSettings>, Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>) extension
Registers Producer.EventHubProducerClient as a singleton in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddAzureEventHubProducerClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingEventHubsProducerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsProducerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsProducerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddAzureEventProcessorClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProcessorSettings>, Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>) Section titled AddAzureEventProcessorClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProcessorSettings>, Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>) extension
Registers EventHubs.EventProcessorClient as a singleton in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddAzureEventProcessorClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingEventHubsProcessorSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsProcessorSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsProcessorSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddAzurePartitionReceiverClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsPartitionReceiverSettings>, Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>) Section titled AddAzurePartitionReceiverClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsPartitionReceiverSettings>, Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>) extension
Registers Primitives.PartitionReceiver as a singleton in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddAzurePartitionReceiverClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<AzureMessagingEventHubsPartitionReceiverSettings>? configureSettings = null,
Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsPartitionReceiverSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsPartitionReceiverSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddKeyedAzureEventHubBufferedProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsBufferedProducerSettings>, Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>) Section titled AddKeyedAzureEventHubBufferedProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsBufferedProducerSettings>, Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>) extension
Registers Producer.EventHubBufferedProducerClient as a singleton for given name in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddKeyedAzureEventHubBufferedProducerClient(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingEventHubsBufferedProducerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsBufferedProducerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsBufferedProducerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddKeyedAzureEventHubConsumerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsConsumerSettings>, Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>) Section titled AddKeyedAzureEventHubConsumerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsConsumerSettings>, Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>) extension
Registers Consumer.EventHubConsumerClient as a singleton for given name in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddKeyedAzureEventHubConsumerClient(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingEventHubsConsumerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsConsumerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsConsumerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubConsumerClient, EventHubConsumerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
ArgumentException Thrown when the name argument is null or empty.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddKeyedAzureEventHubProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProducerSettings>, Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>) Section titled AddKeyedAzureEventHubProducerClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProducerSettings>, Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>) extension
Registers Producer.EventHubProducerClient as a singleton for given name in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddKeyedAzureEventHubProducerClient(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingEventHubsProducerSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsProducerSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsProducerSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventHubProducerClient, EventHubProducerClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddKeyedAzureEventProcessorClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProcessorSettings>, Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>) Section titled AddKeyedAzureEventProcessorClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsProcessorSettings>, Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>) extension
Registers EventHubs.EventProcessorClient as a singleton for given name in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddKeyedAzureEventProcessorClient(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingEventHubsProcessorSettings>? configureSettings = null,
Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsProcessorSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsProcessorSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<EventProcessorClient, EventProcessorClientOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.
AddKeyedAzurePartitionReceiverClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsPartitionReceiverSettings>, Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>) Section titled AddKeyedAzurePartitionReceiverClient(IHostApplicationBuilder, string, Action<AzureMessagingEventHubsPartitionReceiverSettings>, Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>) extension
Registers Primitives.PartitionReceiver as a singleton for given name in the services provided by the builder.
public static class AspireEventHubsExtensions
{
public static void AddKeyedAzurePartitionReceiverClient(
this IHostApplicationBuilder builder,
string name,
Action<AzureMessagingEventHubsPartitionReceiverSettings>? configureSettings = null,
Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>>? configureClientBuilder = null)
{
// ...
}
}
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<AzureMessagingEventHubsPartitionReceiverSettings> optional An optional method that can be used for customizing the AzureMessagingEventHubsPartitionReceiverSettings. It's invoked after the settings are read from the configuration.
configureClientBuilder Action<IAzureClientBuilder<PartitionReceiver, PartitionReceiverOptions>> optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2.
Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.