-
Notifications
You must be signed in to change notification settings - Fork 285
Choosing Whether to Enable Retries in Firebase App Options #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Root Cause: Step 1: Modify FirebaseAppOptions to Accept RetryConfig-- You’ll want to allow RetryConfig to be passed when initializing Firebase. This can be added to the FirebaseAppOptions class. For this, you will need to expose a method to set or get the retry configuration. public class FirebaseAppOptions {
} Step 2: Update the Method to Use the RetryConfig from FirebaseAppOptions Now, update the part of the code that sends requests and retries in Firebase Cloud Messaging, ensuring that the retry configuration can be customized.
} Step 3: Update the Logic to Disable or Customize Retries Modify the retry handling logic to account for the RetryConfig passed during initialization. This would allow the app to customize or disable retries based on user preferences.
} Step 4: Test the Changes Once the change is implemented, you will want to test that: Retries are disabled when you set the RetryConfig with maxRetries set to 0. public static void main(String[] args) {
} Summary of the Fix: Expose RetryConfig to the FirebaseAppOptions so that it can be passed when initializing FirebaseApp.Modify the newAuthorizedRequestFactory method to use the RetryConfig for controlling retries. SOLUTION: |
Hello,
I have learned that FCM automatically retries when a 503 response is received.
However, our service already handles retries for undelivered messages through scheduling, so we do not want to use the default retry strategy.
To disable this behavior, I attempted to use a method provided in the ApiClientUtils class.
However, after debugging the initialization process, I found that it is not possible to set a custom RetryConfig value.
I assume there is a valid reason for restricting the redefinition of RetryConfig.
For example, it may be to prevent retries for responses other than 5xx errors or to avoid excessive retry requests within a short period.
What I would like is the ability to enable or disable the retry feature as needed.
I will proceed with creating a PR for this.
The text was updated successfully, but these errors were encountered: