I am using App Engine Standard Environment (autoscaled), which means I have a limit of 10 mins before a request is cancelled.
Goal is to query data from BigQuery in regular intervals and, for each record, create a task in the task queue, so that records can be processed in the background.
Instructions at https://cloud.google.com/bigquery/create-simple-app-api state to wait for a job like this:
// Create a job ID so that we can safely retry.
JobId jobId = JobId.of(UUID.randomUUID().toString());
Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).setJobId(jobId).build());
// Wait for the query to complete.
queryJob = queryJob.waitFor();
Problem is the 10-minute limit, as BigQuery queries are processed in the background and it may take some time until the result becomes available, so I may not be able to process the response in the same endpoint call.
- Is there a way to receive a callback from BigQuery at a URL, when a query is ready?
- Is there a smarter way to process data from BigQuery in App Engine Standard?
I know I can configure App Engine to extend the maximum time per request, but that can hardly be the solution.