DEV Community

Cover image for Microservices & RabbitMQ On Docker

Microservices & RabbitMQ On Docker

Usama Ashraf on April 25, 2018

A microservices-based architecture involves decomposing your monolith app into multiple, totally independently deployable and scalable services. Be...
Collapse
 
sulsj profile image
Seung-Jin Sul • Edited

Hi Usama, Thanks for useful article! I was wondering if you can help to test it. I've cloned it and hit "docker-compose up" and found the below error. Any idea?

  • apt-cache show+ grep -q erlang-base-hipe Package: erlang-base-hipe

  • apt-get install -y --no-install-recommends erlang-base-hipe
    Reading package lists...
    Building dependency tree...
    Reading state information...
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

The following packages have unmet dependencies:
erlang-base-hipe : Depends: libtinfo6 (>= 6) but it is not installable
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'rabbitmq-server' failed to build: The command '/bin/sh -c set -eux; apt-get update; if apt-cache show erlang-base-hipe 2>/dev/null | grep -q 'Package: erlang-base-hipe'; then apt-get install -y --no-install-recommends erlang-base-hipe ; fi; apt-get install -y --no-install-recommends erlang-asn1 erlang-crypto erlang-eldap erlang-inets erlang-mnesia erlang-nox erlang-os-mon erlang-public-key erlang-ssl erlang-xmerl ; rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Collapse
 
usamaashraf profile image
Usama Ashraf

Hey Seung-Jin, thanks so much. Can I please know what kind of system and environment you're working with?

Collapse
 
peterhasitschka profile image
Peter Hasitschka

Hi Usama!

At first I also want to thank you for that great introduction in that complex but fascinating topic.
While trying out your code I ran in the completely same issue like Seung-Jin described.
I'm running Docker 18.03 on Ubuntu 18.04.

However I managed to get rid of that error by replacing your rabbitmq-image with the native one.
For others who are faced with that error, just replace the rabbitmq-server part in the docker-compose.yml with the following snippet.

rabbitmq-server:
        image: rabbitmq
        hostname: "rabbitmq-server"
        environment:
            RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
            RABBITMQ_DEFAULT_USER: "guest"
            RABBITMQ_DEFAULT_PASS: "guest"
            RABBITMQ_DEFAULT_VHOST: "/"
        ports:
            - "15672:15672"
            - "5672:5672"
        labels:
            NAME: "rabbitmq-server"

This allowed me to successfuly test your environment :-)

Best,
Peter

Thread Thread
 
usamaashraf profile image
Usama Ashraf

Thank you Peter!

Collapse
 
tranphuoctien profile image
Tran Tien

Thank you for diagram!

Collapse
 
kish2011_ profile image
Kishore Sahoo

@usamaashraf Do we need three droplets in AWS or DO for Python, Golang & RabbitMQ services or we can keep three services in one droplet? Thanks

Collapse
 
priyankt68 profile image
Priyank Trivedi

You can keep three services in one droplet itself.

Collapse
 
enriqueedelberto profile image
Edelberto Enrique Reyes

Thanks for sharing. It's really interesting. You explain microservices in a really good way.
Congratulations.