8

I've looked through the Google Cloud API Gateway docs and searched the public issue tracker but haven't been able to find a mention of it one way or another.

The closest I've come is this google groups thread from 4 months ago, which suggests that it may be 60 seconds, but I haven't been able to confirm this or determine if it's out-of-date yet.

TL;DR

I'm looking for alternatives to AWS API Gateway (which has a fixed 30 second timeout) and so am trying to figure out if GCP API Gateway would work as an alternative on this particular point.

grunet
  • 311
  • 2
  • 9

1 Answers1

14

Yes, GCP API gateway does support custom timeout lengths. In your open api spec, underneath "x-google-backend:", insert "deadline: z" where z is the number of seconds till timeout.

Example:

    x-google-backend:
         address: [this-is-your-address]
         deadline: 60.0

The above will give a deadline of 60 seconds.

Dharman
  • 30,962
  • 25
  • 85
  • 135
GCPNoob
  • 141
  • 1
  • 3
  • @grunet Does this [answer](https://stackoverflow.com/help/someone-answers) your question? – Farid Shumbar Jul 07 '21 at 13:27
  • I'm unsure, not having anything handy to try it on. A GCP doc reference would be nice – grunet Jul 08 '21 at 02:21
  • 3
    @grunet Please have a look at these GCP docs: [1](https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-backend) [2](https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#deadline) – Farid Shumbar Jul 26 '21 at 17:34
  • Yeah like I mentioned in the other answer's comment I think these docs are for the old Cloud Endpoints products, not the newer ones that include API gateway (though I might've just been misunderstanding that this whole time...) – grunet Jul 27 '21 at 02:06
  • 3
    I tried the solution and can confirm that the deadline attribute works as expected – b0lle Jan 19 '22 at 09:18
  • GCP doc on deadline: https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-backend – Amogh Mishra Jul 19 '22 at 22:00