I think *@Kurtis Rader *is right. *@**Alex Kiprono*, the *sender* and *consumer* services are connecting to localhost*:5672*, but the *message-broker* service has exposed its port as *5673:5672.* Try using localhost:*5673* in your *AMQP_SERVER_URL* environment variables or change the *message-broker* service *container* and *host* port to *5672:5672*.
Cleberson Pauluci. Em terça-feira, 26 de março de 2024 às 03:17:08 UTC-3, Kurtis Rader escreveu: > Please don't use screenshots for plain text. Screenshots are hard to read > and we can't copy/paste the text in the image. > > The error says it can't connect to 172.21.0.1 port 5672. Do you perhaps > have the port numbers reversed in your "yml compose file"? Is the IP > address correct? > > On Mon, Mar 25, 2024 at 10:55 PM Alex Kiprono <al...@touchvas.com> wrote: > >> am having this error despite setting up environments on yml file and even >> testing by login into the rabbitMq localhost of the rabbitmq container. >> >> >> any assistance will be highly appreciated >> >> yml compose file >> version: "3" >> >> services: >> >> # Create service with RabbitMQ. >> message-broker: >> image: rabbitmq:3-management-alpine >> ports: >> - "5673:5672" # Corrected port mapping for AMQP connections >> - "15673:15672" # for serving RabbitMQ GUI >> volumes: >> - ${HOME}/rabbitmq2/data/:/var/lib/rabbitmq >> - ${HOME}/rabbitmq2/log/:/var/log/rabbitmq >> restart: always >> networks: >> - dev1-network >> >> # Create service with sender. >> sender: >> build: >> context: . >> dockerfile: Dockerfile-sender >> ports: >> - "3000:3000" >> environment: >> AMQP_SERVER_URL: amqp://guest:guest@localhost:5672/ # Use localhost for >> connection >> restart: always >> networks: >> - dev1-network >> depends_on: >> - message-broker >> >> # Create service with message consumer. >> consumer: >> build: >> context: . >> dockerfile: Dockerfile-consumer >> environment: >> AMQP_SERVER_URL: amqp://guest:guest@localhost:5672/ # Use localhost for >> connection >> restart: always >> networks: >> - dev1-network >> depends_on: >> - sender >> - message-broker >> >> networks: >> # Create a new Docker network. >> dev1-network: >> driver: bridge >> >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/0d8bf2eb-6600-4f0b-bf07-06fef5a185c1n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/0d8bf2eb-6600-4f0b-bf07-06fef5a185c1n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b6662a77-2bba-4e91-b815-57098def829fn%40googlegroups.com.