primer cambio

This commit is contained in:
beseira13
2026-01-19 12:12:38 -03:00
parent 5f59dba52d
commit 44990f015a
4759 changed files with 588702 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env node
const amqp = require('../');
const queue = 'rpc_queue';
(async () => {
const connection = await amqp.connect();
const channel = await connection.createChannel();
await channel.consume('amq.rabbitmq.reply-to', async (message) => {
console.log(message.content.toString());
await channel.close();
await connection.close();
}, { noAck: true });
await channel.assertQueue(queue, { durable: false });
channel.sendToQueue(queue, Buffer.from(' [X] ping'), {
replyTo: 'amq.rabbitmq.reply-to',
});
})();