asem mokllati
asem mokllati

Reputation: 245

FCM legacy http throw random (502) Bad Gateway exception

I have an Asp.net that makes about ~100K requests/day on FCM legacy HTTP end point https://fcm.googleapis.com/fcm/send

But every day about 500 randomly requests throw (502) Bad Gateway, and if I tried these requests manually after a while it works and the notification arrives.

Error I get:

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>

Requests that sometimes throw exceptions:

{
   "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"
   }
}

Best regards

Upvotes: 9

Views: 2615

Answers (1)

asem mokllati
asem mokllati

Reputation: 245

Migration to Http v1 solve the issue.

Migration guid: https://firebase.google.com/docs/cloud-messaging/migrate-v1

Caution: Any apps that use device group messaging must continue to use the legacy API for the management of device groups (creating, updating, etc.). The HTTP v1 can send messages to device groups, but does not support management.

Upvotes: 4

Related Questions