mysql-mq

0.6.2 • Public • Published

MySQL Message Queue

Donate Conventional Commits Semantic Release GitHub issues Average time to resolve an issue Percentage of issues still open

mysql-mq provides a message queueing service based on mysql.

Its not build to down to performance, either its optimized to provide a mysql backed message queue if no other queueing service is available or would be oversized for your application.

Install

npm install mysql-mq

Usage

A queue will automatically created when not exists, this create process can be called manually with the "init" method or is executed on first usage of the queue.

Example usage

var mmq = require("mysql-mq");
var testQueue = new mmq('mmq_test', { database: 'mp_example' });

testQueue.put('This is a Test!').then((res) => {
    console.log('Message got ID:', res)

    testQueue.get().then((res) => {
        console.log('Content of Message ID', res.id_message, res.message)

        testQueue.delete(res.id_message).then((res) => {
            console.log('Message deleted')
        })
    })
})

Development

Feel free to fork & contribute!

Testing

Tests need a MySQL Server running, to simplify tests a docker environment can be used. (You need to have docker installed)

Test with docker:

npm run dockertest

Clear all docker containers:

npm run dockerend

/mysql-mq/

    Package Sidebar

    Install

    npm i mysql-mq

    Weekly Downloads

    6

    Version

    0.6.2

    License

    MIT

    Unpacked Size

    31.3 kB

    Total Files

    24

    Last publish

    Collaborators

    • mariof