I am building application that sends notifications to devices using HTTP
interface. Each notification contains unique payload so I have to make one
request for each message. Now I face a problem of sending a large ammount
of notifications (100 000) and I want to use multiple threads to make it a
little faster. The question is: how i honour Retry-After header or exponential
backoff algorythm when one of threads receives an error in response? The
documentation is not clear about this situation:

"If you're sending multiple messages, delay each one independently by an
additional random amount to avoid issuing a new request for all messages at
the same time"

Does this mean that in a situation when thread 1 of 10 is told to wait 2
seconds before retrying, I should delay all threads before they make new
request for let's say 2-3 seconds? What if the first thread to make a
request after the delay receives another error and should therefor wait for
4 seconds? Do I have to stop other threads from making request and make
them wait for another 4-6 seconds? I am not sure what to do. I don't want
to risk being blacklisted. Does anybody have a good solution for this
problem? I will be grateful for any suggestions.


You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm+unsubscribe@googlegroups.com.
To post to this group, send email to android-gcm@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/27a06844-3b84-4f0b-a5e7-d15711bc6230%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-gcm @
postedMay 15, '14 at 7:34p
activeMay 15, '14 at 7:34p

1 user in discussion

Wojciech Hawrot: 1 post



site design / logo © 2019 Grokbase