Google 日历 API v3 returns (503 backendError) 关于频道创建
Google calendar API v3 returns (503 backendError) on channel creation
我正在使用 Java 的日历 API 客户端库来观看频道和获取推送通知。有时,当我尝试在 Google 上创建频道时,它 returns 会出现以下错误响应:
{
"code" : 503,
"errors" : [ {
"domain" : "global",
"message" : "Failed to create channel",
"reason" : "backendError"
} ],
"message" : "Failed to create channel"
}
文档中没有关于处理此错误的内容:
https://developers.google.com/google-apps/calendar/v3/errors
但是,我猜这可能是由于大量请求被发送到 Google 并且它拒绝了连接。也许,这里我需要一段时间后重试。
问题是处理此错误并开始观看所需频道的正确方法是什么?
此问题的路由原因可能是网络流量过大。
Google calendar API 针对此类错误提出了 exponential backoff implementation 的解决方案。
An exponential backoff is an algorithm that repeatedly attempts to execute some action until that action has succeeded, waiting an amount of time that grows exponentially between each attempt, up to some maximum number of attempts.
您可以找到实施思路 here。
我正在使用 Java 的日历 API 客户端库来观看频道和获取推送通知。有时,当我尝试在 Google 上创建频道时,它 returns 会出现以下错误响应:
{
"code" : 503,
"errors" : [ {
"domain" : "global",
"message" : "Failed to create channel",
"reason" : "backendError"
} ],
"message" : "Failed to create channel"
}
文档中没有关于处理此错误的内容:
https://developers.google.com/google-apps/calendar/v3/errors
但是,我猜这可能是由于大量请求被发送到 Google 并且它拒绝了连接。也许,这里我需要一段时间后重试。 问题是处理此错误并开始观看所需频道的正确方法是什么?
此问题的路由原因可能是网络流量过大。 Google calendar API 针对此类错误提出了 exponential backoff implementation 的解决方案。
An exponential backoff is an algorithm that repeatedly attempts to execute some action until that action has succeeded, waiting an amount of time that grows exponentially between each attempt, up to some maximum number of attempts.
您可以找到实施思路 here。