Demon Coldmist
Demon Coldmist

Reputation: 2670

Can not connect to rabbitmq server in docker with error:Connection refused

I just wrote a sprint boot application to connect the rabbitmq and tried to send some test messages, but the connection just be refused. Rabbitmq was installed in the docker which pulled by command docker pull rabbitmq:3-management,

and I started it with command docker run -d --hostname rabbit_test --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:3-management。 However, I can access the web management application with http://ip:15672 and http://localhost:15672.

Here are my configuration in springboot:

spring.rabbitmq.host=ip # I tried with localhost and it just did not work
spring.rabbitmq.port=5762
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.publisher-confirms=true

BTW, I have googled but no helpful information.

Upvotes: 0

Views: 3430

Answers (1)

Meiram Chuzhenbayev
Meiram Chuzhenbayev

Reputation: 906

The default port of rabbitmq server is 5672. Try to use 5672 port

Upvotes: 1

Related Questions