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 stored -
EVENT_BUS_QUEUE
- default:localdev.eventbus
-
RABBITMQ_URL
- default:amqp://guest:guest@127.0.0.1/
Examples
Sample:
-
consumer
:src/examples/consumer.js
-
producer
:src/examples/producer.js
To see them in action, run
-
npm run build
to build project -
npm start
to run eventBus microservice -
npm run consumer
to run example consumer -
npm 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
)