pp-event-bus
v0.0.30
Published
Small library and daemon for distributed event bus based on RabbitMQ
Downloads
246
Maintainers
Readme
eventBus
Small library and microservice form rabbitmq-based event bus.
Usage
npm i --save pp-event-bus
- install library
npm start
- run eventBus microservice
Environment variables
EVENT_BUS_LOG
- path to directory where event logs will be stored; if not set, event logs will not be storedEVENT_BUS_QUEUE
- default:localdev.eventbus
RABBITMQ_URL
- default:amqp://guest:[email protected]/
Examples
Sample:
consumer
:src/examples/consumer.js
producer
:src/examples/producer.js
To see them in action, run
npm run build
to build projectnpm start
to run eventBus microservicenpm run consumer
to run example consumernpm run producer
to run example producer
To run rabbitMQ in docker locally run:
docker compose up -d
- go to http://127.0.0.1:15672/ to see rabbitMQ management console (user/pass -
guest
/guest
)