c# - FCM 旧版 http 随机抛出 (502) 错误网关异常

标签 c# google-cloud-platform google-api firebase-cloud-messaging

我有一个 Asp.net,它在 FCM 传统 HTTP 端点上每天发出大约 10 万个请求
https://fcm.googleapis.com/fcm/send
但是每天大约有 500 个随机请求抛出 (502) Bad Gateway,如果我在一段时间后手动尝试这些请求,它会起作用并且通知到达。
我得到的错误:

Error 502 (Server Error)!!1
<p><b>502.</b>
<ins>That’s an error.</ins>
<p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.  
<ins>That’s all we know.</ins>
有时会抛出异常的请求:
{
   "registration_ids":[
      "token 1",
      "token 2"
   ],
   "data":{
      "type":"navigation",
      "routeName":"Order",
      "Id":"18360"
   },
   "notification":{
      "title":"New Order Placed Successfully",
      "body":"Click here for more details #8073",
      "badge":1,
      "sound":"default"
   }
}
此致

最佳答案

迁移到 Http v1 解决了这个问题。
迁移指南:
https://firebase.google.com/docs/cloud-messaging/migrate-v1
注意:任何使用设备群组消息的应用必须继续使用旧 API 来管理设备群组(创建、更新等)。 HTTP v1 可以向设备组发送消息,但不支持管理。

关于c# - FCM 旧版 http 随机抛出 (502) 错误网关异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64446699/

相关文章:

node.js - 错误 : Cannot find module '/app/__sapper__/build' on Cloud Build

kubernetes - 来自节点而不是 LB 服务的 GKE 集群导出流量

python - "TypeError: cannot instantiate ctype ' EVP_MD_CTX ' of unknown size"在尝试构建 google 预测 api 时

c# - 对多个方法 C# 使用单个事务

c# - 为什么.NET OpenXML SDK 的 SpreadsheetDocument.Open() 方法会抛出 NullReferenceException?

tensorflow - Google Cloud ML 支持 GPU 吗?

android - 关于 android google api-streetview

google-api - 无法在 Visual Studio 2010 Express 或更高版本上安装包 Google.Apis.Auth.Mvc

c# - 使用OpenALPR C#包装器

c# - “返回”与“返回新”之间的区别