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.37.0 › proton › python › docs › index.html
Qpid Proton Python API Documentation — Qpid Proton Python API 0.37.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.39.0 › proton › python › docs › tutorial.html
Tutorial — Qpid Proton Python API 0.39.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 can be used for this purpose if desired.
🌐
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 can be used for this purpose if desired.
🌐
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
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 ...
🌐
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: Copy 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()
🌐
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
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 ...
Find elsewhere
🌐
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%
🌐
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.
🌐
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).
🌐
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
Author: SolaceSamples
🌐
PyPI
pypi.org › project › python-qpid-proton
python-qpid-proton · PyPI
This module provides a Python binding to the Proton AMQP messaging toolkit. Qpid Proton is a high-performance, lightweight messaging library. It can be used in the widest range of messaging applications, including brokers, client libraries, routers, bridges, proxies, and more.
🌐
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).
🌐
Stack Overflow
stackoverflow.com › questions › 68154586 › qpid-proton-python-send-multiple-messages-before-closing
Qpid Proton Python: Send multiple messages before closing - Stack Overflow
June 27, 2021 - connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) channel = connection.channel() channel.queue_declare(queue='hello') channel.basic_publish(exchange='', routing_key='', body='Hello World!') connection.close() The Python Qpid Proton library is sadly not very well documented.
🌐
Stack Overflow
stackoverflow.com › questions › tagged › qpid
Newest 'qpid' Questions - Page 3 - Stack Overflow
I am following this link to receive messages Proton-Python-Example-Simple-Receive. I am passing ... ... Using Qpid for python, I am using the Container to connect to ActiveMq with the connector URL as: username:password@hostname:5672/topicName.
🌐
Apache Qpid
qpid.apache.org › releases › qpid-proton-0.38.0 › proton › cpp › api › mt_page.html
Qpid Proton C++ API: Multithreading
None of the Proton library classes are thread-safe, including proton::container and proton::work_queue. You need an external lock to use proton::container in multiple threads. The only exception is proton::connection::wake(), it is thread-safe even in older C++.