Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cunkz/google-pubsub-nodejs

Example using Google Pub/Sub via NodeJS.
https://github.com/cunkz/google-pubsub-nodejs

google google-cloud-platform nodejs pubsub

Last synced: about 1 month ago
JSON representation

Example using Google Pub/Sub via NodeJS.

Awesome Lists containing this project

README

        

# Google Pub/Sub NodeJS Example

This repository contains examples of using Google Pub/Sub via NodeJS.

## Usage & Installation

First, create Service Account that can access Google Pub/Sub (ex Role : Pub/Sub Admin) via Google IAM. You can continue to create new key using that service account and download it.

After you got the key, run this following command to install requirement NodeJS module :
```bash
npm install
```

After NodeJS module successfully installed, copy `.env.example` file into `.env` and fill value for each environment variable.

Then, execute file `subsriber.js` to create new topic and subscription based `.env` configuration. Open new terminal, execute file `publisher.js` to submit single message into your topic and watch first terminal to check if message has been received.

## Additional Information

If you want to transfer message from pubsub into firestore, maybe you can check [this repository](https://github.com/cunkz/google-cloud-function-pubsub-to-firestore)