Skip to content

khalvai/outbox

Repository files navigation

a simple project to demonstrate how to use outbox pattern to my colleages

rabbitmq used to deliver events to other services(our consumer now is a simple class that just logs)

  • use docker to run rabbit mq:

build -t my-rabbitmq .

docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq my-rabbitmq

and setup rabbit config:

  • 1.create a queue called Event:queue
  • 2.create an exchanged Called: Event and a routing key name: event:published and map to a queue
 npm run start:dev

and you can now

http://localhost:3000/order/issue

  • you will insert a outbox to you databse.

  • and this is the env you need in order to run:

DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mydb?schema=public"
RABBITMQ_URL=amqp://user:password@localhost:5672/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published