sanzharanarbay / golang_rabbitmq_example

Implementation of rabbitmq consumer and producer in golang with docker deployment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Golang rabbit-mq example

How to run rabbitmq and application

  • docker-compose build --no-cache
  • docker-compose up -d
  • docker-compose ps
  • docker-compose logs -f {service-name}
  • send POST request to API' , http://127.0.0.1:8080/api/v1/rabbit-mq/push , for pushing messages
  • docker-compose down (if you want to stop and remove containers)

Body
{
    "id":1,
    "fio":"Sanzhar Anarbay",
    "department":"Test",
    "age":23,
    "mark":3.45
}

  • visit http://localhost:15672/ - (GUI RabbitMQ management ) , (login, password shown in .env file)
  • visit http://localhost:9000/ - Portainer (GUI Docker containers)
  • In portainer open producer-api container and see the logs , to check the message delivery status
  • In portainer open consumer and see the logs , to check is consumer handle the message from the queue
  • There are in general 3 .env files, in root directory , also in the consumer and producer-api directories

About

Implementation of rabbitmq consumer and producer in golang with docker deployment

License:MIT License


Languages

Language:Go 78.4%Language:Dockerfile 16.6%Language:Shell 5.0%