Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var amqp = require('amqplib/callback_api');
- amqp.connect('amqp://TMDG2022:TMDG2022@rmq2.pptik.id:5672/', function(error0, connection) {
- if (error0) {
- throw error0;
- }
- connection.createChannel(function(error1, channel) {
- if (error1) {
- throw error1;
- }
- var queue = 'testing';
- channel.assertQueue(queue, {
- durable: false
- });
- console.log(" [*] Waiting for messages in %s. To exit press CTRL+C", queue);
- channel.consume(queue, function(msg) {
- console.log(" [x] Received %s", msg.content.toString());
- }, {
- noAck: true
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement