使用谷歌云消息传递API时限速超过误差 [英] Rate Limit Exceeded error when using Google Cloud Messaging API
问题描述
在使用谷歌云消息传递API来发送一个后端服务器和一个Android / Chrome浏览器客户端之间的消息,后端服务器可以,有时收到一个限速超过响应code。这code是DeviceMessageRateExceeded为一个<一个一个 HTTP连接服务器和DEVICE_MESSAGE_RATE_EXCEEDED HREF =https://developer.android.com/google/gcm/ccs.html>云连接服务器。
When using the Google Cloud Messaging API to send messages between a backend server and an Android/Chrome client, the backend server can, at times, receive a rate limit exceeded response code. This code is "DeviceMessageRateExceeded" for a HTTP Connection Server and "DEVICE_MESSAGE_RATE_EXCEEDED" for a Cloud Connection Server.
这是什么错误code以及应当如何进行管理?
What is this error code and how should it be managed?
推荐答案
限速例外code表示你是从后端服务器发送消息过于频繁。以确保稳定的服务,存在对可从后端服务器发送的消息的数目的每分钟/每设备的应用程序的上限。此限制设置为高,以便最充分的应用程序的行为应该不会受到影响,但是所有的应用程序应该是ppared收到此错误code $ P $。
The rate limit exception code indicates that you are sending messages from a backend server too frequently. To ensure a stable service, there is a per minute / per device app upper limit on the number of messages that can be sent from a backend server. This limit is set high so most well behaving apps should not be affected, all apps should however be prepared to receive this error code.
作为指定的问题,在一个的HTTP连接服务器的的情况下,错误code将DeviceMessageRateExceeded。而对于一个云连接服务器,这将是DEVICE_MESSAGE_RATE_EXCEEDED,它取代了previous错误codeQUOTA_EXCEEDED。
As specified in the question, in the case of an HTTP Connection Server, the error code will be "DeviceMessageRateExceeded". And for a Cloud Connection Server, it will be "DEVICE_MESSAGE_RATE_EXCEEDED", which is replacing the previous error code "QUOTA_EXCEEDED".
如果后端服务器接收到该错误code,它必须减慢速率发送消息到客户端,最好通过实施指数退避。
If your backend server receives this error code, it must slow down the rate it sends messages to the client, ideally by implementing exponential backoff.
这篇关于使用谷歌云消息传递API时限速超过误差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!