Nest Cloud Run Queue

screenshot of Nest Cloud Run Queue
nestjs

Create a Queue/Worker for NestJS application in Cloud Run.

Overview

The @anchan828/nest-cloud-run-queue package offers a pragmatic solution for implementing queues in NestJS applications running in Google Cloud Run. Since Cloud Run operates in a serverless manner, traditional queue libraries like @nestjs/bull may not work as expected due to the ephemeral nature of server instances. This package effectively bridges that gap by utilizing Google Cloud Pub/Sub and Cloud Tasks, allowing developers to choose an appropriate method for sending messages and processing tasks without the continuous operation of a server.

By leveraging HTTP requests via Cloud Pub/Sub or Cloud Tasks, developers can create efficient message distribution systems for their NestJS apps while maintaining a cost-effective serverless architecture. Whether you're working on a demo locally or deploying in a production environment, this package simplifies the queueing process within Cloud Run, promoting a seamless workflow.

Features

  • Supports Multiple Messaging Systems: Choose between Cloud Pub/Sub and Cloud Tasks to fit your project's requirements for sending and processing messages.
  • Publisher Packages: Includes dedicated libraries for both Cloud Pub/Sub and Cloud Tasks, simplifying the setup process for sending messages.
  • Worker Package: A robust library for creating applications that receive and process incoming messages, streamlining your task handling.
  • Customizable Controllers: Automatically defines a controller for message receipt, with the option to create custom controllers as needed.
  • Configurable Worker Functionality: Enables disabling of worker processes, allowing flexibility when reusing the same application across different environments.
  • Manual Execution of Workers: Offers the ability to execute workers or processors manually, providing control over processing timing and execution.
  • Local Development Support: Use a demo with an emulator to run Pub/Sub and Tasks locally, making it easier to test and develop before deployment.
nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.