AMQParty
All I wanted was to build a great microservices using RabbitMQ. but I can't understand all these terms... and all this boilerplate.. waaaa...
So lets party.
Installing
npm install --save amqparty
Using
const amqparty = ; // Just connect with the amqp library settingsamqparty;
Handling data in a service
const connect handle = ; const listen = { console; ;}; ;
How it works
sender
- creates a queue('joe', 'userInfo')
- returns a function that:
- generates a uuid
- add a subscriber to the subscribers object:
- will call the callback
- unbind the queue
- remove the subscriber from the subscribers object
- binds the queue to
userInfo.response.${uuid}
- sends data
handle({ exchange: 'joe', name: 'userInfo' }, callback...)
creates a queue (userInfo
) that binds to userInfo.request