rmq-client

Easiest, Elegant RabbitMQ Client

Usage no npm install needed!

<script type="module">
  import rmqClient from 'https://cdn.skypack.dev/rmq-client';
</script>

README

RabbitMQ Client

Easiest, Elegant RabbitMQ Client

Installation

npm i rmq-client

Basic Usage

import { RabbitMQClient } from 'rmq-client';

async function main(): Promise<void> {
    const client = await RabbitMQClient.connect({
        endpoint: 'rhea-so.com:5672',
        username: 'guest',
        password: 'guest',
        vhost: '/',
        maximumConcurrentThroughput: 1
    });

    const queue = await client.createQueue('test');
    queue.enqueue('Hello, World!');
    await new Promise((resolve, _reject) => {
        queue?.dequeue(async (data) => {
            console.log(data);
            resolve(data);
        });
    });

    await queue.destroy();

    await client.close();
}

main();

Learn More

  1. Connection
  2. Queue
  3. Publish & Subscribe

Test Result

https://github.com/rhea-so/RabbitMQClient/blob/main/TEST_RESULT.png?raw=true

Support Git History

Credits

Based on these amazing projects:

License

MIT