In my GAE app I need to perform an OAuth2 flow by passing an authentication code to a Google endpoint in order to retrieve a user's profile. As part of this process, I also need to store the user's email address in GAE Datastore. The following points have been documented about GAE and Java 8:
- Each request is limited to 50 concurrent App Engine API request threads. - When using threads, use high level concurrency objects, such as Executor and Runnable. Those take care of many of the subtle but important details of concurrency like Interrupts and scheduling and bookkeeping - The maximum number of concurrent background threads created by the App Engine API is 10 per instance. (This limit doesn't apply to regular Java threads unrelated to the App Engine API.) Taken from: https://cloud.google.com/appengine/docs/standard/java/runtime-java8 So what happens when I have 100 concurrent requests occurring? Since only 50 concurrent App Engine API request threads is allowed, what happens to the requests once this limit is reached? Does GAE simply just put those requests in a waiting cache or terminate the request by issuing some response with a failure code? Does an exception get thrown? Or does GAE start up a new instance to service the new requests (I would hope so)? It also isn't clear how to interpret what is meant by 50 concurrent App Engine API request threads. Does this mean that my servlet will only ever see a maximum of 50 current requests at any given time? Or does it mean that these threads are only applicable to App Engine APIs such as storing data in the Datastore or Cloud Storage? And then there is third bullet item that says there is a maximum of 10 background threads per instance for App Engine APIs. How is this different than the 50 request threads? And finally, to accomplish my goal of obtaining the user's profile, should I be using a task queue or a thread to accomplish this? It seems that task queues were the original way of doing things before support for Java 8 threads was provided. Or have I misunderstood something? Thanks for clarifying this. Johann -- 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 google-appengine+unsubscr...@googlegroups.com. To post to this group, send email to google-appengine@googlegroups.com. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/1901724a-1d61-4ccd-a5f9-00495642687e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.