Google-api-nodejs-client: Add support for HTTP/2 requests

Created on 24 Apr 2018  路  9Comments  路  Source: googleapis/google-api-nodejs-client

With the demise of batch, we need a better way to make requests in tight loops:
https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html

We should try out the experimental HTTP/2 support in node.js core, and provide an API to turn it on.

feature request

All 9 comments

Hello @JustinBeckwith, sadly batches were removed from library, I marked this day in calendar with a sad emoji. 馃槩

Would be great if you can give any recommendations on how to make thousands of homogeneous requests to Google Drive API. I have to perform similar actions (files.update) on a lot of files (thousands). I faced API quotas and have to limit requests pressure and backoff strategy from my side.

At the moment I'm using Batchelor to organise requests in batches, this requires a bit of extra auth routines and feels like a bit different. Is there a best practice how to perform mass similar operations to Google Drive?

We should try out the experimental HTTP/2 support in node.js core, and provide an API to turn it on.

With Node v10 the http2 module has become a stable addition, and I trust that the Google API:s themselves support HTTP/2. What are the current blockers / steps towards supporting HTTP/2 requests? Does request need to support HTTP/2? Let us know the game plan, and we can help out in relevant ways :)

Has this issue gone anywhere? I'm currently moving away from global batch endpoints and proper HTTP/2 support would be hugely helpful.

@nickbclifford we've released a variety of the APIs supported by google-api-nodejs-client as gRPC libraries, which use http2 for transport, a list can be found here:

https://github.com/googleapis/google-cloud-node

There's no immediate plan to add http2 support to google-api-nodejs-client.

Is there a better solution available using other APIs that aren't available through Google Cloud (i.e. Gmail)? Since batching was removed, there's really no obvious first-party solution for many API requests.

If there won't be http2 support in this library, can we have a example in how to use the /batch/library/v1 endpoints manually? I need to reduce the overhead in looping and making a ton of RESTful requests.

Thanks

I had success with using "request" to perform a batch request, but sadly this library is deprecated so I don't want to use it. I couldn't even get a curl to work but "request" worked fine, I don't what I'm doing wrong.
Seems like I will have to refrain from using the batch endpoints and send multiple requests at a time

Good news everyone! We have experimental HTTP/2 support brewing here:
https://github.com/googleapis/google-api-nodejs-client/pull/2246

For those interested in the gory details, the real magic is here:
https://github.com/googleapis/nodejs-googleapis-common/pull/293

Since it's been a while since this landed, calling this done :) Please it out and leave feedback!
https://github.com/googleapis/google-api-nodejs-client#http2

Was this page helpful?
0 / 5 - 0 ratings