context deadline while posting notification through API https:///dm3p.notify.windows.com?token=xxx

景轩 王 35 Reputation points
2024-11-28T06:15:46.9966667+00:00

got many timeout when using wns for push.

from api https:///dm3p.notify.windows.com?token=xxx

I have been using this function for a year without any problems. This timeout problem has occurred since around 9:00 (utc+8, china) this morning. How can I contact the R & D staff to deal with it? When is it expected to be restored?

example

Post "https://dm3p.notify.windows.com/?token={my token}": context deadline exceeded (Client.Timeout exceeded while awaiting headers)> req=&http.Request{Method:"POST", URL:(*url.URL)(0xc0d8a8e3f0), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"Authorization":[]string{"Bearer {my ak}"}, "Content-Type":[]string{"text/xml"}, "X-Wns-Requestforstatus":[]string{"true"}, "X-Wns-Tag":[]string{"c9b6cef39c0d5cae"}, "X-Wns-Ttl":[]string{"28797"}, "X-Wns-Type":[]string{"wns/toast"}}, Body:io.nopCloserWriterTo{Reader:(*bytes.Buffer)(0xc08fa6c6c0)}, GetBody:(func() (io.ReadCloser, error))(0x7a3ea0), ContentLength:1610, TransferEncoding:[]string(nil), Close:false, Host:"dm3p.notify.windows.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.valueCtx)(0xc08fa6c450)} 
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.
334 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,093 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 1,130 Reputation points Microsoft Vendor
    2024-11-28T17:33:11.3166667+00:00

    Hi @景轩 王
    Thanks for the question and using MS Q&A platform.
     Increase Timeout Settings: Adjust your application's timeout duration to a higher value to prevent premature timeouts.

     Verify Network Connectivity: Ensure a stable network connection to avoid timeouts when connecting to WNS.

    https://zcusa.951200.xyz/en-us/windows/apps/design/shell/tiles-and-notifications/windows-push-notification-services--wns--overview

    Validate WNS Endpoint: Check that the WNS endpoint URL is correct and accessible using a browser or tools like curl.

     Monitor Server Load: Verify if WNS is under heavy load or experiencing outages by checking Microsoft’s service status.

    Analyse Logs and Responses: Review logs for error messages and confirm the correct format of headers and payloads.

    Implement Retry Logic: Add retry logic to handle transient errors, ensuring successful notifications even after initial failures.
    Troubleshooting push notifications

    Troubleshooting push notifications - Windows apps |Microsoft Learn

    Troubleshooting WNS push notifications - Windows apps | Microsoft Learn
    reference:

    https://zcusa.951200.xyz/en-us/azure/notification-hubs/configure-windows-push-notification-service

    https://zcusa.951200.xyz/en-us/azure/notification-hubs/notification-hubs-windows-store-dotnet-get-started-wns-push-notification

    https://zcusa.951200.xyz/en-us/windows/apps/windows-app-sdk/notifications/push-notifications/push-quickstart?source=recommendations

    I hope this information is helpful.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.