fairymq-consumer-nodejs

1.2.0 • Public • Published


fairyMQ Node.JS Consumer


import Consumer from 'fairymq-consumer-nodejs'

let consumer = new Consumer("privatekey.pem") // Startomg a new consumer


    Consumer.Listen() // Start listening

    consumer.events.on('event', (data) => {
        // do something magical with data!
    })
}

If you want to restrict what messages one consumer can intake by key:

consumer.ConfigureKey("banana")

Now regardless of what's enqueued the listener will only accept messages with the key of banana

To change the port of a consumer; So you can have multiple:

consumer.SetPort("9992")

Package Sidebar

Install

npm i fairymq-consumer-nodejs

Weekly Downloads

1

Version

1.2.0

License

GPL-3.0-or-later

Unpacked Size

104 kB

Total Files

5

Last publish

Collaborators

  • fairymq