python-qpid-proton

raw JSON →
0.40.0 verified Mon Apr 27 auth: no python

An AMQP based messaging library providing a high-level API for AMQP 1.0 messaging. Current version is 0.40.0. Release cadence is irregular, with occasional major or minor releases.

pip install python-qpid-proton
error ModuleNotFoundError: No module named 'qpid'
cause Incorrect import path; top-level package is 'proton'.
fix
Use 'from proton import Messenger' instead of 'import qpid.proton'.
error AttributeError: module 'proton' has no attribute 'Messenger'
cause Messenger class was removed or renamed in newer versions.
fix
Check version; if >=0.40.0, use 'proton.reactor' or 'proton.handlers' instead.
breaking In version 0.40.0, the library dropped support for Python 2. Also, the API changed from blocking to non-blocking I/O in some components.
fix Upgrade to Python 3.6+ and update code to use non-blocking patterns if using old synchronous Messenger API.
gotcha The 'proton' module name clashes with other packages (e.g., Proton VPN). Ensure correct installation and import.
fix Always import from 'proton' after installing 'python-qpid-proton'. Verify via 'pip list'.
deprecated The 'Messenger' API is considered legacy in AMQP 1.0; use the 'proton.reactor' for newer applications.
fix Consider using 'proton.reactor.Container' or 'proton.handlers' for modern AMQP handling.

Creates a Messenger, sends a message to an AMQP queue. Ensure an AMQP broker is running.

from proton import Messenger, Message

messenger = Messenger()
messenger.start()

msg = Message(body="Hello world")
messenger.put("amqp://0.0.0.0:5672/myqueue", msg)
messenger.send()

messenger.stop()