top of page

Get auto trading tips and tricks from our experts. Join our newsletter now

Thanks for submitting!

How to run Docker RabbitMQ and Python Pika package

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

https://rillabs.com/posts/pub-sub-with-zeromq-in-python

This results in very very fast queue connection!


0 views0 comments

Comments


bottom of page