Firebase Admin SDK Java Backoff/retry

烈酒焚心 提交于 2020-01-24 21:50:07

问题


In implementing a Firebase Server Environment I ran across some requirements in the documentation: https://firebase.google.com/docs/cloud-messaging/server#role

Namely, the requirement that the server provide facilities for backoff/retry.

Is there some direction as to how the Firebase Admin SDK usage should be wrapped in such logic or is the logic contained within the SDK itself?

I did see this in the Firebase Admin SDK release notes that does mention handling of retry for 500 response codes: https://firebase.google.com/support/release-notes/admin/java#version_681_-_april_24_2019

Since the ErrorCodes mentioned here don't actually return the numeric response codes, it's unclear whether they are covered by this change. https://firebase.google.com/support/release-notes/admin/java#firebase-cloud-messaging_1

Are there other usage constraints or limitations one should consider when implementing such a server?


回答1:


Admin SDK already does this for you. All retry-eligible errors (that's all HTTP 500 and 503 errors) are retried up to 4 times with exponential backoff. If the error response contains Retry-After header, that is respected too.



来源:https://stackoverflow.com/questions/57962587/firebase-admin-sdk-java-backoff-retry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!