RabbitMQ connection with docker container

384 views
Skip to first unread message

GOPAL GOTE

unread,
Jul 19, 2023, 1:49:01 AM7/19/23
to rabbitmq-users
Hi Rabbitmq Team,

I'm trying to dockerize rabbitmq and my nodejs application. After creating images both images are working and I can access on chrome. But while doing a connection between node image with rabbitmq  image that time facing below error. 

{ Error: connect ECONNREFUSED 10.4.0.2:5672
    at Object.exports._errnoException (util.js:1024:11)
at exports._exceptionWithHostPort (util.js:1047:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1150:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '10.4.0.2',
port: 5672 },
isOperational: true,
 code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
 syscall: 'connect',
address: '10.4.0.2',
port: 5672 }

Note: Both images are running on the same network. RabbitMQ is accessible on 
chrome using http://localhost:15672  url 

Rabbit MQ details: 
version: 3.9.29
Erlang version:  25.3.2.3

Nodejs version: 8.2.0

Url used for rabbitMQ and node application connection:

1
amqp://<username>:<password>@<ip-address>:5672 2.amqp://localhost:5672
Reply all
Reply to author
Forward
0 new messages