1.0.1 • Published 4 years ago
rmq-client v1.0.1
RabbitMQ Client
Easiest, Elegant RabbitMQ Client
Installation
npm i rmq-clientBasic 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
Test Result

Support Git History
Credits
Based on these amazing projects:
- rhea by JeongHyeon Kim
License
MIT