Occasional MessagingException when sending Push Notifications through Azure NotificationHub

MrTomHawkins 1 Reputation point
2020-09-02T16:12:35.203+00:00

I'm using Azure Notification Hub to send Push Notifications (from an Azure web app), and am occasionally getting errors like this in my logs:

Microsoft.Azure.NotificationHubs.Messaging.MessagingException: Unexpected exception encountered TrackingId:c9d0dc7e-c98a-4f38-bfb4-cff867b0aa02,TimeStamp:2020-09-02T14:05:12.0050613Z
---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request.
---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request

I'm only sending a max of 10 messages every minute using the NotificationHubClient package from Nuget (v3.3.0). These errors only started happening within the past week, but I'm getting a couple dozen a day now. I cannot reliably reproduce the error, it only seems to happen now and then, with a different set of recipients each time. I'm using the free Notification Hub tier, so I don't have access to per-message telemetry.

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
264 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,910 questions
{count} votes

1 answer

Sort by: Most helpful
  1. sadomovalex 3,626 Reputation points
    2020-09-03T14:57:35.227+00:00

    just to check: in free tier there is 1mln pushes limit with 500 active devices per namespace (here). Are you sure that didn't reach these limits?
    Also what service plan your Azure web app is using? Limits may be also reached there.