-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Service Bus] Improve errors and update API docs as per the feedback from UX study #11592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 38 additions & 69 deletions
107
...vicebus/Azure.Messaging.ServiceBus/src/Compatibility/ServiceBusClientBuilderExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,44 @@ | ||
| #pragma warning disable SA1636 // File header copyright text should match | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| #pragma warning restore SA1636 // File header copyright text should match | ||
| // Licensed under the MIT License. | ||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusSenderClient"/> instance with the provided <paramref name="connectionString"/> and <paramref name="eventHubName"/> | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusSenderClient, ServiceBusSenderClientOptions> AddEventHubProducerClient<TBuilder>(this TBuilder builder, string connectionString, string eventHubName) | ||
| // where TBuilder : IAzureClientFactoryBuilder | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusSenderClient, ServiceBusSenderClientOptions>(options => new ServiceBusSenderClient(connectionString, eventHubName, options)); | ||
| // } | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusSenderClient"/> instance with the provided <paramref name="fullyQualifiedNamespace"/> and <paramref name="eventHubName"/> | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusSenderClient, ServiceBusSenderClientOptions> AddEventHubProducerClientWithNamespace<TBuilder>(this TBuilder builder, string fullyQualifiedNamespace, string eventHubName) | ||
| // where TBuilder : IAzureClientFactoryBuilderWithCredential | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusSenderClient, ServiceBusSenderClientOptions>((options, token) => new ServiceBusSenderClient(fullyQualifiedNamespace, eventHubName, token, options)); | ||
| // } | ||
| using Azure.Core.Extensions; | ||
| using Azure.Messaging.ServiceBus; | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusSenderClient"/> instance with connection options loaded from the provided <paramref name="configuration"/> instance. | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusSenderClient, ServiceBusSenderClientOptions> AddEventHubProducerClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) | ||
| // where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusSenderClient, ServiceBusSenderClientOptions>(configuration); | ||
| // } | ||
| namespace Microsoft.Extensions.Azure | ||
| { | ||
| /// <summary> | ||
| /// The set of extensions to add the Service Bus client types to the clients builder | ||
| /// </summary> | ||
| public static class ServiceBusClientBuilderExtensions | ||
| { | ||
| /// <summary> | ||
| /// Registers a <see cref="ServiceBusClient "/> instance with the provided <paramref name="connectionString"/>. | ||
| /// </summary> | ||
| /// | ||
| public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClient<TBuilder>(this TBuilder builder, string connectionString) | ||
| where TBuilder : IAzureClientFactoryBuilder | ||
| { | ||
| return builder.RegisterClientFactory<ServiceBusClient, ServiceBusClientOptions>(options => new ServiceBusClient(connectionString, options)); | ||
| } | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusReceiverClientOptions"/> instance with the provided <paramref name="connectionString"/> | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusReceiverClient, ServiceBusReceiverClientOptions> AddEventHubConsumerClient<TBuilder>(this TBuilder builder, string consumerGroup, string connectionString) | ||
| // where TBuilder : IAzureClientFactoryBuilder | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusReceiverClient, ServiceBusReceiverClientOptions>(options => new ServiceBusReceiverClient(consumerGroup, connectionString, options)); | ||
| // } | ||
| /// <summary> | ||
| /// Registers a <see cref="ServiceBusClient"/> instance with the provided <paramref name="fullyQualifiedNamespace"/>. | ||
| /// </summary> | ||
| /// | ||
| public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClientWithNamespace<TBuilder>(this TBuilder builder, string fullyQualifiedNamespace) | ||
|
JoshLove-msft marked this conversation as resolved.
|
||
| where TBuilder : IAzureClientFactoryBuilderWithCredential | ||
| { | ||
| return builder.RegisterClientFactory<ServiceBusClient, ServiceBusClientOptions>((options, token) => new ServiceBusClient(fullyQualifiedNamespace, token, options)); | ||
| } | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusReceiverClient"/> instance with the provided <paramref name="connectionString"/> and <paramref name="eventHubName"/> | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusReceiverClient, ServiceBusReceiverClientOptions> AddEventHubConsumerClient<TBuilder>(this TBuilder builder, string consumerGroup, string connectionString, string eventHubName) | ||
| // where TBuilder : IAzureClientFactoryBuilder | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusReceiverClient, ServiceBusReceiverClientOptions>(options => new ServiceBusReceiverClient(connectionString, eventHubName, options)); | ||
| // } | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusReceiverClient"/> instance with the provided <paramref name="fullyQualifiedNamespace"/> and <paramref name="eventHubName"/> | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusReceiverClient, ServiceBusReceiverClientOptions> AddEventHubConsumerClientWithNamespace<TBuilder>(this TBuilder builder, string consumerGroup, string fullyQualifiedNamespace, string eventHubName) | ||
| // where TBuilder : IAzureClientFactoryBuilderWithCredential | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusReceiverClient, ServiceBusReceiverClientOptions>((options, token) => new ServiceBusReceiverClient(fullyQualifiedNamespace, eventHubName, token, options)); | ||
| // } | ||
|
|
||
| // /// <summary> | ||
| // /// Registers a <see cref="ServiceBusReceiverClient"/> instance with connection options loaded from the provided <paramref name="configuration"/> instance. | ||
| // /// </summary> | ||
| // /// | ||
| // public static IAzureClientBuilder<ServiceBusReceiverClient, ServiceBusReceiverClientOptions> AddEventHubConsumerClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) | ||
| // where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> | ||
| // { | ||
| // return builder.RegisterClientFactory<ServiceBusReceiverClient, ServiceBusReceiverClientOptions>(configuration); | ||
| // } | ||
| // } | ||
| //} | ||
| /// <summary> | ||
| /// Registers a <see cref="ServiceBusClient"/> instance with connection options loaded from the provided <paramref name="configuration"/> instance. | ||
| /// </summary> | ||
| /// | ||
| public static IAzureClientBuilder<ServiceBusClient, ServiceBusClientOptions> AddServiceBusClient<TBuilder, TConfiguration>(this TBuilder builder, TConfiguration configuration) | ||
| where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> | ||
| { | ||
| return builder.RegisterClientFactory<ServiceBusClient, ServiceBusClientOptions>(configuration); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.