azure-sdk-for-net
azure-sdk-for-net copied to clipboard
EventHubBufferedProducerClient: Builder Extensions
Summary
Once the EventHubBufferedProducerClient has been implemented, it will need to be integrated with the EventHubClientBuilderExtensions for use with ASP.NET and other integrations.
Because the configuration requires that event handler registration be supported, and likely that the host timeout for shutting down be extended to allow time for flushing, we'll need to determine the correct pattern.
Scope of Work
-
Coordinate with Pavel to understand the story behind the
IAzureClientBuilderand get his thoughts on the scenario and possible approaches. Do not forget to discuss the event handlers AND potential configuration for extending the host shutdown. -
Prototype as needed to lock in a design; ensure that Pavel endorses the design.
-
Update the EventHubClientBuilderExtensions implementation.
Success Criteria
-
The client builder extensions support the buffered producer client.
-
The tests necessary for sample validation have been created or adjusted and pass reliably.
-
The existing test suite continues to produce deterministic results and pass reliably.
Related Issues and References
After discussing with Pavel, there's no currently supported way to influence arbitrary host configuration, such as the timeout for shutting down. There would also be challenges around finding the right pattern to register the success and failure handlers for the producer.
We agreed that it would be better to start with samples of manually registering the buffered producer and configuring the environment. If there is enough customer interest, we likely want to consider rescoping this issue to cover creating a Microsoft.Extensions.Azure.EventHubs package to allow for dependencies on ASP.NET and which provides a more opinionated and specific approach for hooking the buffered producer into ASP.NET DI. If we go down that path, we should also consider creating an IHostedService implementation that can be used to make hosting the EventProcessorClient in an ASP.NET context easier.
For now, I'm bumping this to the backlog and we'll reconsider at a later point.
After revisiting, this would be better addressed in a stand-alone sample where configuration for shutdown timeouts can be demonstrated. Closing this out.