8.1.0 • Published 2 years ago

mqemitter-mongodb v8.1.0

Weekly downloads
297
License
MIT
Repository
github
Last release
2 years ago

mqemitter-mongodb  Build Status

MongoDB powered MQEmitter.

See MQEmitter for the actual API.

js-standard-style

Install

$ npm install mqemitter-mongodb --save

Example

var mongodb = require('mqemitter-mongodb')
var mq = mongodb({
  url: 'mongodb://127.0.0.1/mqemitter?auto_reconnect'
})
var msg  = {
  topic: 'hello world',
  payload: 'or any other fields'
}

mq.on('hello world', function (message, cb) {
  // call callback when you are done
  // do not pass any errors, the emitter cannot handle it.
  cb()
})

// topic is mandatory
mq.emit(msg, function () {
  // emitter will never return an error
})

API

MQEmitterMongoDB(opts)

Create a new instance of mqemitter-mongodb.

Options:

  • url: a mongodb endpoint url
  • database: a mongodb database name, by default it comes from the uri
  • mongo: options for mongodb client
  • db: a db instance of mongodb (instead of url)

Acknowledgements

Code ported from Ascoltatori.

License

MIT

8.1.0

2 years ago

8.0.0

2 years ago

7.0.4

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.0

5 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.2

7 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago