I am developing a consumer for a third party RabbitMQ broker over AMQP 1.0 protocol. Where I am unable to consume messages for the reason that this Third party asks us to consume messages by connecting to a RabbitMQ exchange. Where as I understand that an exchange is for producing but not for consuming messages.
the third party is insisting on consumption from exchange and has not provided any queue name. Please help me If my understanding is wrong and provide any references to library that can support me.
Solution Design.
- Protocol: AMQP 1.0
- Client Library: Apache ProtonJ2
- Broker Product: RabbitMQ
- Programing Language: Java 17
The ICD provides following insights,
- Exchange:- The exchange is not bind to any queue
- Producer:- Producer is sending messages but these are getting discarded for the reason that exchange is bot bind to any queue.
- Consumer:- as soon as the consumer connects to the exchange, RabbitMQ creates a server named queue and binds it to the exchange.
- Consumer:- Consumer starts receiving messages from the exchange as the bound queue contains the messages. Please not that consumer has not created any connection to this server named queue. Consumer shall only connect to exhcnage
Please help me in proton library example to do this.
Since you didn't provide more informations to your code i would answer with a basic consumer boilerplate: