On Mon, Jul 8, 2013 at 1:29 PM, <[email protected]> wrote: > Our service sends more then 10.000 messages every day through GCM. > But about every day there are one or more messages which could not be > delivered according to the following stack trace: > > Uncaught exception from servlet > > java.io.IOException: Could not fetch URL: > https://android.googleapis.com/gcm/send > > > The exception occurs at following position: > MulticastResult results = sender.send(message, tokens, 5); > > Does anyone has some ideas what the resason of this problem could be? > > Just to be clear, you're saying that your application sends 10,000 urlfetches to the GCM API endpoint (each one is a single message), and that every day "one or more" urlfetches fail?
Sounds about right. Some quick napkin math: (1 urlfetch failure / 10,000 urlfetch uses) * (100 percent) = 0.01% urlfetch failure rate (check my math, I'm about to go to bed at the time of writing this!). URLFetch occasionally fails. It's just a fact of life on App Engine. The best thing for you to do is to catch the exception and retry the urlfetch. Better yet, put your urlfetch code within a task and queue up a task when you need to send a GCM message, the task queue service will automatically retry the task if it fails. P.S. I notice you said you were from Germany. Is your GAE application hosted in a US datacenter or an European datacenter ( https://groups.google.com/forum/#!topic/google-appengine/Oon8Ds3dlO4 )? Assuming that the GCM API is hosted out of a different region than your application, you may be experiencing higher urlfetch failure simply due to your location. ----------------- -Vinny P Technology & Media Advisor Chicago, IL App Engine Code Samples: http://www.learntogoogleit.com -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
