1.2.0 • Published 2 years ago

fairymq-consumer-nodejs v1.2.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

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")
1.2.0

2 years ago