1.0.1 • Published 3 years ago

rmq-client v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

1.0.1

3 years ago

1.0.0

3 years ago