Your program suggests a misunderstanding of the way Qpid works.

In Qpid (for AMQP protocols 0-8 to 0-10) message producers send messages to Exchanges. The Exchange is then responsible for routing the message to zero or more Queues. The precise details of that routing depend on the exchange type. It is through this mechanism that Qpid supports common messaging topologies (point-to-point, publish/subscribe, fanout etc).

Your use-case requires the use of an instance of a direct exchange (such as the built-in amq.direct).

A direct exchange routes messages to queues based on an exact match between the routing key of the message, and the binding key used to bind the queue to the exchange. A common convention is to bind the queue to the exchange using the name of queue itself as binding key. It appears your program is currently using the string "routing_key" for this purpose, and I suspect will explain the undesired behaviour you observed.

You will find more explanation here:

http://qpid.apache.org/releases/qpid-0.24/java-broker/book/Java-Broker-Concepts-Exchanges.html (Qpid Java Broker documentation - but the concept is shared)

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_MRG/1.1/html/Messaging_User_Guide/chap-Messaging_User_Guide-Exchanges.html (Redhat's MRG docs explain the same concepts with useful diagrams)

The Python Examples (see Qpid website) are a useful reference.

Answer from k-wall on Stack Overflow
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.40.0 › proton › python › docs › index.html
Qpid Proton Python API Documentation — Qpid Proton Python API 0.40.0 documentation
This object should then be passed to the convenience methods proton.reactor.Container.create_sender() and/or proton.reactor.Container.create_receiver() as needed. The connection class may be found at proton.Connection. The peer that sends messages uses a sender to send messages, which includes the target queue or topic which is to receive the messages.
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.40.0 › proton › python › docs › tutorial.html
Tutorial — Qpid Proton Python API 0.40.0 documentation
1from proton.reactor import Container, Copy 2from proton.handlers import MessagingHandler 3 4 5class Recv(MessagingHandler): 6 def __init__(self): 7 super(Recv, self).__init__() 8 9 def on_start(self, event): 10 conn = event.container.connect("localhost:5672") 11 event.container.create_receiver(conn, "examples", options=Copy()) 12 13 def on_message(self, event): 14 print(event.message) 15 if event.receiver.queued == 0 and event.receiver.drained: 16 event.connection.close() 17 18 19try: 20 Container(Recv()).run() 21except KeyboardInterrupt: 22 pass · Tutorial · Hello World! Hello World, Direct! Asynchronous Send and Receive · Request/Response · Miscellaneous · AMQP Types · Show Source · index · previous | Qpid Proton Python API 0.40.0 documentation » ·
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.37.0 › proton › python › docs › tutorial.html
Tutorial — Qpid Proton Python API 0.37.0 documentation
To run the example, you will need to have a broker (or similar) accepting connections on that url either with a queue (or topic) matching the given address or else configured to create such a queue (or topic) dynamically. There is a simple broker.py script included alongside the examples that ...
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.36.0 › proton › python › docs › tutorial.html
Tutorial — Qpid Proton Python API 0.36.0 documentation
To run the example, you will need to have a broker (or similar) accepting connections on that url either with a queue (or topic) matching the given address or else configured to create such a queue (or topic) dynamically. There is a simple broker.py script included alongside the examples that ...
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.39.0 › proton › python › docs › tutorial.html
Tutorial — Qpid Proton Python API 0.39.0 documentation
1from proton.reactor import Container, Copy 2from proton.handlers import MessagingHandler 3 4 5class Recv(MessagingHandler): 6 def __init__(self): 7 super(Recv, self).__init__() 8 9 def on_start(self, event): 10 conn = event.container.connect("localhost:5672") 11 event.container.create_receiver(conn, "examples", options=Copy()) 12 13 def on_message(self, event): 14 print(event.message) 15 if event.receiver.queued == 0 and event.receiver.drained: 16 event.connection.close() 17 18 19try: 20 Container(Recv()).run() 21except KeyboardInterrupt: 22 pass · Tutorial · Hello World! Hello World, Direct! Asynchronous Send and Receive · Request/Response · Miscellaneous · AMQP Types · Show Source · index · previous | Qpid Proton Python API 0.39.0 documentation » ·
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.39.0 › proton › python › docs › overview.html
API Overview — Qpid Proton Python API 0.39.0 documentation
Qpid Proton Python API 0.39.0 documentation » · API Overview · Messages are transferred between connected peers over ‘links’. At the sending peer the link is called a sender. At the receiving peer it is called a receiver. Messages are sent by senders and received by receivers. Links may have named ‘source’ and ‘target’ addresses (for example to identify the queue from which message were to be received or to which they were to be sent).
🌐
GitHub
github.com › Bynder › qpid-bow
GitHub - Bynder/qpid-bow: Qpid Bow is a higher level client framework for Python 3.6+ to communicate with AMQP/Qpid servers combined with a set of CLI tools to manage a Qpid server. · GitHub
As a framework Qpid Bow can provide you with a higher level interface on top of the low level Qpid Proton library to integrate with AMQP/Qpid queues, exchanges and Remote Procedure Call (RPC) functionality: Simple, callback based receiver, supporting listening for multiple queues. RPC calls with automatic temporary queues and callbacks. Queue based sender. Included Qpid management code for queue/exchange creation. Support to run under Python's asyncio event loop with async def callbacks.
Starred by 10 users
Forked by 7 users
Languages   Python 99.4% | Makefile 0.6%
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.38.0 › proton › python › docs › overview.html
API Overview — Qpid Proton Python API 0.38.0 documentation
Qpid Proton Python API 0.38.0 documentation » · API Overview · Messages are transferred between connected peers over ‘links’. At the sending peer the link is called a sender. At the receiving peer it is called a receiver. Messages are sent by senders and received by receivers. Links may have named ‘source’ and ‘target’ addresses (for example to identify the queue from which message were to be received or to which they were to be sent).
Find elsewhere
🌐
GitHub
github.com › SolaceSamples › solace-samples-amqp-qpid-proton-python
GitHub - SolaceSamples/solace-samples-amqp-qpid-proton-python · GitHub
May 16, 2024 - python src/simple_send.py --url amqp://<msg_backbone_ip:port> --username user --password password -a queue.name
Starred by 7 users
Forked by 9 users
Languages   Python 84.7% | Shell 15.3%
🌐
Stack Overflow
stackoverflow.com › questions › 69873946 › qpid-proton-python-detecting-an-empty-queue-in-on-message
Qpid Proton Python detecting an empty queue in on_message - Stack Overflow
If this were a single-threaded consumer, then no problem; but I may have several consumers going against the one queue so knowing exactly how many messages are on the queue is not possible. So for example, on the on_message method (this comes from the Qpid Python documentation (direct_recv.py) we have this: def on_message(self, event): if event.message.id and event.message.id < self.received: # ignore duplicate message return if self.expected == 0 or self.received < self.expected: print(event.message.body) self.received += 1 if self.received == self.expected: event.receiver.close() event.connection.close() self.acceptor.close()
🌐
Stack Overflow
stackoverflow.com › questions › tagged › qpid-proton
Newest 'qpid-proton' Questions - Stack Overflow
January 2, 2024 - We are using proton for AMQP 1.0, and we used Pika for AMQP 0.9. We are using Blocking Connection. In AMQP 0.... ... Thanks for helping!!! I'm new to Artemis, but got really surprised by it's potencial! I'm working with ActiveMQ Artemis and a Python client built with Qpid Proton (version 0.39.0).
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_build_of_apache_qpid_proton_python › 0.40 › html › using_qpid_python › overview
Chapter 1. Overview | Using Qpid Python | Red Hat build of Apache Qpid Proton Python | 0.40 | Red Hat Documentation
Red Hat build of Apache Qpid Proton Python sends and receives messages. Messages are transferred between connected peers over senders and receivers. Senders and receivers are established over sessions. Sessions are established over connections. Connections are established between two uniquely identified containers.
🌐
GitHub
github.com › SolaceSamples › solace-samples-amqp-qpid-proton-python › blob › master › src › simple_send.py
solace-samples-amqp-qpid-proton-python/src/simple_send.py at master · SolaceSamples/solace-samples-amqp-qpid-proton-python
May 16, 2024 - Demonstrates how to create an amqp connection and a sender to publish messages. ... The amqp address can be a topic or a queue.
Author   SolaceSamples
🌐
Google Groups
groups.google.com › g › rabbitmq-users › c › GYhJ4-JaKEs
Reconnect to topic queue via qpid-proton AMQP1.0
February 23, 2022 - However, after a connection abort, i can't see a way to reconnect to the already existing queue using the queue-name of the last successful connection and consume messages that haven't been delivered because of the lost connection.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_build_of_apache_qpid_proton_python › 0.40 › html › using_qpid_python › examples
Chapter 4. Examples | Using Qpid Python | Red Hat build of Apache Qpid Proton Python | 0.40 | Red Hat Documentation
For more examples, see the Red Hat build of Apache Qpid Proton Python example suite and the Qpid Proton Python examples. This client program connects to a server using <connection-url>, creates a sender for target <address>, sends a message containing <message-body>, closes the connection, and exits.
🌐
PyPI
pypi.org › project › python-qpid-proton
python-qpid-proton
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser