Pulling messages in nodejs

505 views
Skip to first unread message

Debasish Das

unread,
May 1, 2018, 9:51:53 AM5/1/18
to Google Cloud Pub/Sub Discussions
Hi,

The api-redesign for nodejs released in v0.14 removed the subscription.pull method.

If i was using subscription.pull({ returnImmediately: true }) earlier, is there some guidance on how i should do it instead with the api re-design. Current design on the application side is that it wakes up every so often, does some other work, checks for pending messages, processes if any and then goes back to idle. This could be redesigned but before i embark on that i wanted to see if there is a simpler replacement for the earlier pull approach. Seems nodejs client lib currently doesnt support the synchronous pull. 


Thanks

Katayoon (Cloud Platform Support)

unread,
May 1, 2018, 2:50:23 PM5/1/18
to Google Cloud Pub/Sub Discussions

Hi, here you can find a detailed explanation on Client libraries. It is mentioned that If you want to use one of Google Cloud Client Libraries and there is no Cloud Client Library for your preferred language, you can still use an older version of our client libraries called Google API Client Libraries [2].


You may use pull method in Pub/Sub Google Cloud Client Library (latest version 0.18.x) for your use-case.


Debasish Das

unread,
May 2, 2018, 8:07:37 AM5/2/18
to Google Cloud Pub/Sub Discussions
Thanks. I ended up using the SubscriberClient and that meets my needs.
Reply all
Reply to author
Forward
0 new messages