问题
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