arcus-azure/arcus.messaging

Provide capability to restart message pump if secret for connection string was updated

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
Provide the capability to restart message pump if secret for connection string was updated so that we don't have to wait for unauthorized exceptions and we always use the connection string that should be used.

When this is the case, new messages should no longer be received and currently being processed messages should be completed instead of abrupt shutdown.

Describe the solution you'd like
Based on Key Vault events we see that the secret containing the connection string was changed after which the host restarts itself.

Describe alternatives you've considered
Wait for unauthorized exceptions, but that doesn't cover the scenario where the app is assigned to a new service bus namespace or less permissions.

Additional context
I'm not sure if this should be the default or through opt-in since this can lead to two restarts when using sec/primary rotation and assignments.

It could be the default if the message pump was registered with retrieving the connection string from Key Vault. When it's registered to retrieve it from the configuration, we can fallback on the exceptions.

Can you elaborate a bit on your idea please? I'm not sure I'm fully grasping your proposal.