queue-publisher-package
v1.0.0
Published
Shared queue publisher package that allows microservices to publish to Rabbit MQ queues
Downloads
5
Readme
Using the package in microservices:
const RabbitMQPublisher = require('queue-publisher-package');
const publisher = new RabbitMQPublisher();
async function sendMessageToQueue(queueName, message) { try { await publisher.publishToQueue(queueName, message); } catch (error) { console.error('Failed to send message to queue:', error); // Handle error } }
// Example usage: const message = { key: 'value' }; sendMessageToQueue('myQueue', message);