amqpLibTest(){
alert("connection Started")
let amqp = require('amqplib/callback_api');
debugger
amqp.connect('amqp://myuser:notapassword@123.123.123.xyz.com:5672',
function(err, conn) {
console.log("Conn Values=======>", conn)
conn.createChannel(function(err, ch) {
let q = 'harbinger-dm-control-response';
ch.assertQueue(q, {durable: true});
console.log(" [*] Waiting for messages in %s. To exit press CTRL+C", q);
ch.consume(q, function(msg) {
let js = JSON.parse(msg.content.toString());
console.log(js);
}, {noAck: true});
});
});
}
I am trying to connect to rabbitmq service which is running on another server. It is giving me below ERRORs: Error of my Library
The Error in browser console is:-
Uncaught TypeError: webpack_require(...).connect is not a function
at connect (connect.js:169)
at Object.connect (callback_api.js:14)
at App.amqpLibTest (App.js:54)
at new App (App.js:44)
at constructClassInstance (react-dom.development.js:11447)
at updateClassComponent (react-dom.development.js:13144)