Closed PeterOscarsson closed 4 years ago
@marstr I can take care of this. This can be solved by constructor overload which takes HttpClient
.
It is actually possible today. Constructor accepts an instance of NotificationHubClientSettings
which has a property MessageHandler
. If that property is set, HttpClient will use that handler. https://github.com/Azure/azure-notificationhubs-dotnet/blob/master/src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs#L78
I use the NotificationHubClient as a Singleton in my long-running service. (> 1 month) When the DNS (IP) for the HUB changes (a few times per year) this is not reflected in the singleton NotificationHubClient (due to "new HttpClient()") and I'll get exceptions in my code and have to restart the whole service to reflect the DNS change.
What is the correct way to solve this in code right now and is there any plans to use the IHttpClientFactory to create the HttpClient instead, which also should solve the problem.