Monday, 5 June 2017

Trouble connecting to CloudAMQP via winston-amqp

I am struggling to make a remote connection to a CloudAMQP instance using the winston-amqp transporter in node.

We are using winston for logging in our application and my goal is to connect our winston logging middleware to RabbitMQ so we can place our logs onto a queue.

I have successfully connected to the CloudAMQP from node having followed this article

However, I wish to configure it directly via winston as a transporter. This is the module I am trying to use to connect make the connection between my express app and CloudAMQP: https://github.com/kr1sp1n/winston-amqp

My connection config looks like the below:

const winston = require('winston');
const amqp = require('winston-amqp').AMQP;

let rabbitMQConnection = {
  name: 'test',
  host: 'puma.rmq.cloudamqp.com',
  port: '5672',
  vhost: 'zzzzzz',
  login: 'zzzzzz',
  password: 'xxxxxxxxxx'
};
winston.add(amqp, rabbitMQConnection);

With that configuration I get the following error message:

{ Error: read ECONNRESET
    at exports._errnoException (util.js:1036:11)
    at TCP.onread (net.js:564:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }

The support at CloudAMQP have told me that my host name is correct having given them my actual vhost value.

¯_(ツ)_/¯



via DWJB

No comments:

Post a Comment