Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/cunkz/google-pubsub-nodejs
- Owner: cunkz
- Created: 2022-02-15T10:58:50.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-19T13:21:09.000Z (almost 3 years ago)
- Last Synced: 2023-11-06T10:54:22.066Z (about 1 year ago)
- Topics: google, google-cloud-platform, nodejs, pubsub
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)