-
Notifications
You must be signed in to change notification settings - Fork 467
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
Added implementation to support EventHubBufferedProducerClient #3833
Added implementation to support EventHubBufferedProducerClient #3833
Conversation
@WhitWaldo - it looks like the tests are failing. Can you fix them? |
@eerhardt Fixed |
@sebastienros - can you take a look at this? |
src/Components/Aspire.Azure.Messaging.EventHubs/EventHubBufferedProducerClientComponent.cs
Outdated
Show resolved
Hide resolved
👋 @WhitWaldo - I'm looking at the same piece of functionality missing. Would you intend to bring this up to date, or are you ok with someone else updating it? |
@skolima I can bring it up to date over the weekend. It just fell off my radar! |
This has been updated and should be ready to go now! |
@sebastienros - can you take a look? |
src/Components/Aspire.Azure.Messaging.EventHubs/AspireEventHubsExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Aspire.Azure.Messaging.EventHubs/AspireEventHubsExtensions.cs
Show resolved
Hide resolved
/// <param name="configureClientBuilder">An optional method that can be used for customizing the <see cref="IAzureClientBuilder{TClient, TOptions}"/>.</param> | ||
/// <remarks>Reads the configuration from "Aspire:Azure:Messaging:EventHubs:{TClient}" section, where {TClient} is the type of Event Hubs client being configured, i.e. EventProcessorClient.</remarks> | ||
/// <exception cref="InvalidOperationException">Thrown when neither <see cref="AzureMessagingEventHubsSettings.ConnectionString"/> nor <see cref="AzureMessagingEventHubsSettings.FullyQualifiedNamespace"/> is provided.</exception> | ||
public static void AddKeyedAzureEventHubBufferedProducerClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious - when do we return the builder from such a method, and when do we use void?
cc @sebastienros @eerhardt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave that philosophy to others, but here I'm just mirroring the return type taken for the existing extensions (void)
.
|
||
protected override void BindClientOptionsToConfiguration(IAzureClientBuilder<EventHubBufferedProducerClient, EventHubBufferedProducerClientOptions> clientBuilder, IConfiguration configuration) | ||
{ | ||
#pragma warning disable IDE0200 // Remove unnecessary lambda expression - needed so the ConfigBinder Source Generator works |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious - what is this about? Is it a bug in the source generator that we are working around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simply copied the approach taken in the existing consumer client component. I don't know what it is it's referring to, but if it's necessary there, I figured it should be included in this class as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration.Bind
is replaced at compiled time by a source generated version. But if you use a method group then the source generator doesn't kick in. To see the code expand the project like this:
Look for a method named Bind_EventHubBufferedProducerClientOptions
and check the attribute on it that will point to the method to switch for.
All Aspire.Azure.Messaging.EventHubs.Tests are passing on my system and I believe I've spoken to each of the reviews above. |
I think the only thing missing is updating the README to list the new client/settings. Just do a quick search for ProducerClient for the missing mentions. |
@WhitWaldo I did the required changes in the README. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Multiple tests failing like this (log):
|
Out of curiosity, is there any way to access that log without being a part of Microsoft? The tests passed locally but I saw the bot report a failure and I couldn't figure out how to access the log myself. |
Are you not able to access that link? I pasted the failures here anyway - https://gist.github.com/radical/1f55987361a1a828b3ed888b081e2dbe . |
…aldo/dotnet-aspire into eventhub-buffered-producer
Head branch was pushed to by a user without write access
When I ran the tests locally before, I believe I ran them against the wrong branch. Re-resolved the comments above on the correct branch this time and fixed the unit tests + added inline tests for the new class to the mix. Now, they're all passing locally. |
I can access the link you provided, but is there any way to access those logs from the failed check itself (e.g. assuming I don't have access to the azdo environment)? |
When the checks complete then you can see the details, and links to the failures in |
src/Components/Aspire.Azure.Messaging.EventHubs/EventHubBufferedProducerClientComponent.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the one comment, LGTM!
Implemented my own ask from #3832 to support the EventHubBufferedProducerClient in addition to the EventHubProducerClient as part of the Aspire DI registration.
Microsoft Reviewers: Open in CodeFlow