AMQP 0-9-1 Overview
- The AMQP Protocol
- Connections & Channels
- Publishers and Consumers
More Exchange Types
More Consumer Features
Reliable Message Delivery
High Availability and Backup
Management HTTP API
LavinMQ with Python
The recommended library for Python to access LavinMQ servers is Pika.
Before we jump right into writing our code, let’s set up the development environment.
Python development environment
- First make sure that you have Python and that it’s available from your command line.
You can confirm this by running:
- If you get a
NameError: name 'python' is not defined, then you do not have Python. Download Python from python.org or you could even use pyenv to manage multiple Python versions
python3 -m venv env-nameon Unix and macOS or
python -m venv env-nameon Windows to create a virtual environment where we install the dependencies for our project. Replace
env-namewith whatever name you chose for your virtual environment.
source env-name/bin/activateon Unix and macOS or
.\env-name\Scripts\activateon Windows to activate the virtual environment.
- Open your project directory in your favourite text-editor and create a
python-dotenvto requirements.txt file.
- Install dependencies with
pip install -r requirements.txt
- Create a
.envfile in in the root directory
CLOUDAMQP_URL="lavinmq_url"to the `.env’ file. Replace lavinmq_url with your correct server url
Ready to take the next steps? Here are some things you should keep in mind:
Managed LavinMQ instance on CloudAMQP
LavinMQ has been built with performance and ease of use in mind - we've benchmarked a throughput of about 1,000,000 messages/sec. You can try LavinMQ without any installation hassle by creating a free instance on CloudAMQP. Signing up is a breeze.