-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Is your feature request related to a problem? Please describe.
Improve fluent API with builder pattern so that we control what the following methods are that can be called.
services.AddServiceBusQueueMessagePump(secretName, options => options.JobId = jobId)
.WithServiceBusMessageHandler<OrdersAzureServiceBusMessageHandler, Order>();
services.WithAutoRestartServiceBusQueueMessagePumpOnRotatedCredentials(...);This is to make it more clear and less verbose since every extension we have today is returning IServiceCollection.
This also helps new people to explore what the other options are for configuring the runtime.
Describe the solution you'd like
Return a IServiceBusMessagePumpBuilder which enforces you to call WithServiceBusMessageHandler, WithAutoRestartOnRotatedCredentials and/or ... after AddServiceBusQueueMessagePump
services.AddServiceBusQueueMessagePump(secretName, options => options.JobId = jobId)
+++ .WithAutoRestartOnRotatedCredentials(...)
.WithServiceBusMessageHandler<OrdersAzureServiceBusMessageHandler, Order>();
--- services.WithServiceBusMessageHandler<OrdersAzureServiceBusMessageHandler, Order>(); <-- No longer possible on services directly
--- services.WithAutoRestartServiceBusQueueMessagePumpOnRotatedCredentials(...); <-- No longer possible on services directlyWhat I would not do, however, is have a Build method at the end.
Describe alternatives you've considered
Nothing specifically, but open to suggestions.
Additional context
Add any other context or screenshots about the feature request here.