-
Notifications
You must be signed in to change notification settings - Fork 645
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
Adding backoff mechanism to google-fcm #923
Comments
cc @tg44 |
Yeah... I mentioned it in the documentation :D If I remember well, the streams-contrib has a stage for exponential backoff. The problem in general, that we need to know when we can retry and when there is some other error. The sendWithPassthrough can pass the retry number, so if you know when you can safely retry and how much failed send is enough to actually give up; its not that hard to write the functionality for your problem. I had more problems when tried to generalize this;
So if you have any idea/concept I'm happy to help/code it, but when I started to implement this I faced too much problems. |
I agree that the FCM documentation could have been more detailed. What I assume is that when there is an error code INTERNAL or UNAVAILABLE in the response it means the message should be backed off. My thought about how it might work was that when you get a response from the server which signals a backoff it would schedule an exponential retry of sending (num of attempts configurable) and postpone fulfilling a promise which would eventually decrease demand and back-pressured. I was also also thinking about restarting the whole flow but it would mean losing some of the messages in it which is not desirable. |
Okay so if I understand well, you want to restart the code inside the future with something like a recoverWith. This has a ton of possible problems... For example what happens when the token is about to expire but we start to retry the request (and get unauth)? What happens if all our threads are backing off (but we could send to other devices, just the actuals broken in the google side)? BTW unauth is a retryable response in some cases but the recoverWith method will make it hard to solve. I personally think this is much worst then building a cycle... I will thinking about it. |
This will be fixed in #2613. |
Fixed in #2613 |
Hi,
thanks for the FCM connector. Have you thought about adding support for backoff mechanism needed by the FCM server ? It'd be very useful to have it as a part of the connector itself rather than implementing it outside.
The text was updated successfully, but these errors were encountered: