Skip to content

Latest commit

 

History

History

README.md

09-message-queue

BullMQ email queue with Redis, plus an in-memory fallback when REDIS_URL is unset.

Quick start

npm install
cp .env.example .env
npm run dev

Without Redis, jobs run through the in-memory fallback (ideal for local dev and tests).

With Redis:

# start redis locally, then set REDIS_URL in .env
REDIS_URL=redis://localhost:6379 npm run dev

Enqueue an email job:

curl -X POST http://localhost:3000/api/jobs/email \
  -H "Content-Type: application/json" \
  -d '{"to":"user@example.com","subject":"Hello","body":"Queued message"}'

Tests

npm test

Related examples

Example Topic
08-events Domain events
10-redis-cache Redis cache
12-docker-compose Postgres + Redis via Docker