1
votes

Our GAE application uses the Google Cloud Endpoints API for Java, but we need one of the endpoints to execute some complex operations which take a few minutes (more than the request timeout). As stated in this question, for long running tasks (<10 min is enough for me) we should use the task queue API, but according to the documentation:

Note: You cannot call a Google Cloud Endpoint directly from a push task queue or a cron job.

Is there any other solution? Ideally I would really like to just make a request to a specific endpoint, to reuse all the code of the handler. Is that possible?.

Thanks in advance,
Rafael.

1

1 Answers

0
votes

I would do the following:

  1. Move your handler code to a task queue method, outside of the API method.
  2. Have the method now return an operation ID which maps to a task name.
  3. Have a new method that takes the ID and returns task state.

In this case, the task queue is not calling an Endpoints method. It's not clear to me why you need to do so in this case, but there's a workaround if you need to, which is to have the task queue call an internal URL which then calls the Endpoints method.