Skip to main content

RabbitMQ Python connector

develop master

Basic RabbitMQ Python connector.

Contents

Introduction

eea.rabbitmq.client is a connector for a RabbitMQ server.

API

Usage example:

from eea.rabbitmq.client import RabbitMQConnector

rabbit_config = {
    'rabbit_host': "10.0.0.1",
    'rabbit_port': "8080",
    'rabbit_username': "admin",
    'rabbit_password': "admin"
}
queue_name = "QUEUE_NAME"

rabbit = RabbitMQConnector(**rabbit_config)
rabbit.open_connection()
rabbit.declare_queue(queue_name)
rabbit.send_message(queue_name, "body text")
rabbit.close_connection()

Strings vs. bytes

RabbitMQ messages are bytes, though they may optionally have an encoding flag. When consuming messages, in Python 3, they are received as bytes, and should be decoded:

method, properties, body = rabbit.get_message(queue_name)
message = body.decode(properties.content_encoding or 'ascii')

Changelog

1.9 - (2020-05-13)

  • Feature: added Python3 support. [mgax refs #116195]

1.8 - (2019-01-28)

  • Jenkins: Add sonarqube step [avoinea refs #101552]

1.7 - (2018-09-24)

1.6 - (2018-08-21)

  • Feature: add configuration and utilities for RabbitMQ client [GhitaB refs #91506]

  • Change: updated URLs pointing to eea.europa.eu with https:// [alecghica refs #95849]

1.5 - (2017-12-12)

  • Change: Replace eeacms/zptlint with eeacms/plone-test:4 zptlint [avoinea refs #90415]

1.4 - (2017-04-24)

  • Change: updated package information [eduard-fironda]

1.3 - (2016-09-05)

  • Bug fix: fixed pylint [chiridra refs #72772]

1.2 - (2016-08-29)

  • Change: disabled hearbeat interval to avoid disconnections. [chiridra refs #72772]

1.1 - (2016-05-12)

  • Change: turned package into a proper plone package [ichim-david refs #71940]

1.0 - (2016-05-04)

  • Feature: added documentation [alecghica refs #69689]

  • Bug fix: fixed package structure [alecghica refs #69689]

  • Feature: innitial release [szabozo0 refs #69689]

Release files for eea.rabbitmq.client 1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eea.rabbitmq.client 1.9
File Size Uploaded
eea.rabbitmq.client-1.9.zip 15.6 kB Details

Release files / eea.rabbitmq.client-1.9.zip

Download URL eea.rabbitmq.client-1.9.zip
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
017b06e1abb81bb25b1f08dc29a582371173af3bf8531c98b892e0a8f72a3c72
BLAKE2b-256 checksum
How to use checksums
ce28d747912528378cba51ace397092748d3ae027e1ba4223566ceb0d17c0b3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.17

Release history Release notifications | RSS feed

This release

1.9 This release

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page