https://github.com/iadvize/mq-library
Wrapper around amqplib to manage easily rabbitmq connections and binding declarations
https://github.com/iadvize/mq-library
mq-library rabbitmq wrapper
Last synced: 3 months ago
JSON representation
Wrapper around amqplib to manage easily rabbitmq connections and binding declarations
- Host: GitHub
- URL: https://github.com/iadvize/mq-library
- Owner: iadvize
- License: mit
- Created: 2015-03-24T10:09:45.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T09:19:39.000Z (over 5 years ago)
- Last Synced: 2024-04-15T15:31:33.300Z (about 2 years ago)
- Topics: mq-library, rabbitmq, wrapper
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 3
- Watchers: 48
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# mq-library [](https://badge.fury.io/js/mq-library)
Wrapper around amqplib to Manage easily rabbitmq connections and binding declarations.
## Examples
```javascript
var amqpConfig = {
connection: {
host: 'rabbitmq',
port: 5672,
vhost: '/',
user: 'guest',
pass: 'guest',
useConfirms: false
},
exchanges: [
{name: 'domain.events', type: 'topic', durable: true},
{name: 'domain.events.DL', type: 'topic'},
{name: 'domain.notifs', type: 'fanout', durable: true}
],
queues: [
{name: 'domain.events.queue', subscribe: true, messageTtl: 60000, deadLetterExchange: 'domain.events.DL'},
{name: 'domain.notifs.queue', messageTtl: 60000}
],
bindings: [
{exchange: 'domain.events', target: 'domain.events.queue', keys: ['some.routing.key.*']},
{exchange: 'domain.notifs', target: 'domain.notifs.queue'}
]
};
var mq = require('mq-library')(amqpConfig, logger);
mq.then(function (channel) {
channel.consume('domain.events.queue', someFancyFunction);
channel.consume('domain.notifs.queue', someOtherFancyFunction);
});
```
## Install
```bash
npm install mq-library --save
```
## Documentation
### How to publish a new version
```bash
npm install npm-release -g
npm-release [major|minor|patch]
```
npm-release is a little script to help release npm modules. It:
- Bumps the version in package.json
- Commits 'Release x.x.x'
- Tags
- Pushes to upstream
- Publish on npm (if `private:true` is not present in package.json)
## Contribute
Look at contribution guidelines here : [CONTRIBUTING.md](CONTRIBUTING.md)