'AMQP Closing all channels from connection when docker run on port 5672

I have run Rabbitmq as a docker compose and it work well with port 15672 on browser, but 5672 not working.

docker-compose

rabbitmq:
    image: 'rabbitmq:3-management-alpine'
    container_name: rabbitmq
    ports:
      - '5672:5672'
      - '15672:15672'
    environment:
      - RABBITMQ_NODE_TYPE=stats
      - RABBITMQ_NODE_NAME=rabbit@stats
      - RABBITMQ_ERL_COOKIE=s3cr3tc00ki3
      - RABBITMQ_DEFAULT_USER=rabbitmquser
      - RABBITMQ_DEFAULT_PASS=rabbitmquser
    volumes:
      - '/rabbitmq/data:/var/lib/rabbitmq/'
      - '/rabbitmq/log:/var/log/rabbitmq'

spring application.properties

spring.rabbitmq.host = 192.168.1.212
spring.rabbitmq.port = 15672
spring.rabbitmq.username = rabbitmquser
spring.rabbitmq.password = rabbitmquser

error in docker log when enter http://192.168.100.12:5672

2021-04-07 13:30:07.742 [info] <0.731.0> Resetting node maintenance status
2021-04-07 13:31:27.979 [info] <0.1050.0> accepting AMQP connection <0.1050.0> (192.168.2.2:62786 -> 172.19.0.4:5672)
2021-04-07 13:31:28.093 [error] <0.1050.0> closing AMQP connection <0.1050.0> (192.168.2.2:62786 -> 172.19.0.4:5672):
{bad_header,<<"GET / HT">>}
2021-04-07 13:31:28.111 [info] <0.1055.0> Closing all channels from connection '192.168.2.2:62786 -> 172.19.0.4:5672' because it has been closed
2021-04-07 13:31:29.224 [info] <0.1053.0> accepting AMQP connection <0.1053.0> (192.168.2.2:62787 -> 172.19.0.4:5672)
2021-04-07 13:31:29.225 [error] <0.1053.0> closing AMQP connection <0.1053.0> (192.168.2.2:62787 -> 172.19.0.4:5672):
{bad_header,<<"GET / HT">>}
2021-04-07 13:31:29.228 [info] <0.1062.0> Closing all channels from connection '192.168.2.2:62787 -> 172.19.0.4:5672' because it has been closed
2021-04-07 13:31:34.276 [info] <0.1060.0> accepting AMQP connection <0.1060.0> (192.168.2.2:62789 -> 172.19.0.4:5672)
2021-04-07 13:31:34.280 [error] <0.1060.0> closing AMQP connection <0.1060.0> (192.168.2.2:62789 -> 172.19.0.4:5672):
{bad_header,<<"GET / HT">>}
2021-04-07 13:31:34.282 [info] <0.1069.0> Closing all channels from connection '192.168.2.2:62789 -> 172.19.0.4:5672' because it has been closed
2021-04-07 13:31:44.279 [info] <0.1067.0> accepting AMQP connection <0.1067.0> (192.168.2.2:62790 -> 172.19.0.4:5672)
2021-04-07 13:31:44.280 [error] <0.1067.0> closing AMQP connection <0.1067.0> (192.168.2.2:62790 -> 172.19.0.4:5672):
{handshake_timeout,handshake}
2021-04-07 13:31:44.282 [info] <0.1073.0> Closing all channels from connection '192.168.2.2:62790 -> 172.19.0.4:5672' because it has been closed

error in spring

declaring queue for inbound: springCloudBus.anonymous.PRr6HWmwTqGU2akit5Rc9Q, bound to: springCloudBus
Attempting to connect to: [192.168.1.212:15672]
Channel 'springCloudBus.anonymous.PRr6HWmwTqGU2akit5Rc9Q.errors' has 1 subscriber(s).
Broker not available; cannot force queue declarations during start: java.net.ConnectException: Connection timed out: no further information
onsumer raised exception, processing can restart if the connection factory supports it. Exception summary: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection timed out: no further information


Solution 1:[1]

Change:

spring.rabbitmq.port = 5672

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jevon Kendon