I have this rabbitMQ docker container running:
version: '3'
services:
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- 5672:5672
- 15672:15672
volumes:
- ./.rabbitmq/data/:/var/lib/rabbitmq
- ./.rabbitmq/log/:/var/log/rabbitmq
and it runs well.
I have a nodejs script put_message_into_queue.ts
, that connects to it and tries to put some message into a queue.
I also have some worker code in another script that consumes messages in the same queue.
As I check the management console:
I can see two connections, corresponding to the two scripts running different processes. If I click one of the connections:
About the title: Connection 172.21.0.1:56526 -> 172.21.0.2:5672
:
172.21.0.1: what does this address mean?
56526: what does this port mean?
172.21.0.2: this should be the ip address of the rabbitMQ docker container
5672: this is the port specified in the docker-compose
How is 172.21.0.1:56526
related to one of my running script?
When I run the script, it does not run on any port.
so what is 172.21.0.1:56526
?