1
mqlight와 함께 nodejs를 사용하여 https://www.npmjs.com/package/mqlight에 의해 제공되는 샘플 코드를 실행하고 있습니다.nodejs + mqlight 연결 오류
nodejs 5.5.0을 사용 중이며 npm 버전은 3.3.12입니다.
npm install mqlight을 사용하여 mqlight를 설치했습니다.
var mqlight = require('mqlight'); var recvClient = mqlight.createClient({service: 'amqp://localhost'}); var topicPattern = 'public'; recvClient.on('started', function() { recvClient.subscribe(topicPattern); recvClient.on('message', function(data, delivery) { console.log('Recv: %s', data); }); }); var sendClient = mqlight.createClient({service: 'amqp://localhost'}); var topic = 'public'; sendClient.on('started', function() { sendClient.send(topic, 'Hello World!', function (err, data) { console.log('Sent: %s', data); sendClient.stop(); }); });
위의 코드를 실행하는 동안 오류가 발생했습니다.
E:\nodejs>node mqtest.js events.js:154 throw er; // Unhandled 'error' event ^ NetworkError: CONNECTION ERROR (localhost:5672): Connect failure: The remote co mputer refused the network connection. at Socket.connError (E:\nodejs\node_modules\mqlight\mqlight.js:1437:19) at emitOne (events.js:90:13) at Socket.emit (events.js:182:7) at emitErrorNT (net.js:1255:8) at nextTickCallbackWith2Args (node.js:474:9) at process._tickCallback (node.js:388:17)
이 문제를 해결하는 데 도움을주십시오. 윈도우 7 64 비트 OS를 사용하고 있습니다.
mqlight를 다운로드하고 컴퓨터에서 시작 했습니까? 그렇지 않은 경우 - https://developer.ibm.com/messaging/ibm-mq-light-downloads/에서 다운로드 할 수 있습니다. 서비스가 실행 중인지 확인하고 기본 구성을 변경하지 않은 경우 즉시 연결할 수 있어야합니다. –
빠른 응답을 보내 주셔서 감사합니다 ... –