How to run Docker RabbitMQ and Python Pika package

(Last Updated On: May 7, 2020)

Here are the instructions to get a message queue working with Docker and RabbitMQ on MacOs:

Free trading books https://quantlabs.net/ or learn algo trading https://quantlabs.net/dvd

  1. Install Docker onto your desktop like Mac https://docs.docker.com/docker-for-mac/install/
  2. Test it https://docs.docker.com/docker-for-mac/
  3. Test Rabbit MQ https://www.rabbitmq.com/tutorials/tutorial-one-python.html but note: Prerequisites
    This tutorial assumes RabbitMQ is installed and running on localhost on standard port (5672). In case you use a different host, port or credentials, connections settings would require adjusting.
  4. You can launch RabbitMQ as instructed here https://www.rabbitmq.com/download.html but run in a terminal:

docker run -it –rm –name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

4 Follow instructions and understand to run send.py and receive.py Python scripts

There goes that idea about hosting this combo on a remost hosted cloud server like I got:

We don’t really recommend using Docker on a server with a control panel, particularly cPanel. It’s possible that Docker could interfere with cPanel services and then we wouldn’t be able to directly support that.

It might be better to look at an unmanaged Cloud server that doesn’t have a control panel and all the various services running on common service ports by default.

In fact, most of us techs have personal servers without control panels so we can run applications that don’t play nice with a control panel.

So my only solution is to look at ZeroMQ https://zeromq.org/

The easiest example of Pub Sub model is


This results in very very fast queue connection!

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
share this recipe:

Still hungry? Here’s more

Automated Bots: Your Key to Stock Trading Success

Automated bots are rapidly gaining ground in the stock market, and if you’re still trading manually, the box will outrun you. Yes, you heard it right! These powerful bots are set to become the new norm, and those who embrace them will have a significant advantage over those who don’t.

Read More

Are you interested in: