So, I'm about 2 hours trying to figure it why my published messages weren't arriving on my consumer, and it turns out I should be using the queueName as routing-key for the publisher!
I only discovered this after looking up if the go-rabbitmq was creating an exchange for me, it turns out if left unspecified it binds to the default rabbitmq exchange:
The default exchange is a direct exchange with no name (empty string) pre-declared by the broker. It has one special property that makes it very useful for simple applications: every queue that is created is automatically bound to it with a routing key which is the same as the queue name.
So, I'm about 2 hours trying to figure it why my published messages weren't arriving on my consumer, and it turns out I should be using the queueName as routing-key for the publisher!
I only discovered this after looking up if the
go-rabbitmq
was creating an exchange for me, it turns out if left unspecified it binds to the default rabbitmq exchange:https://www.rabbitmq.com/tutorials/amqp-concepts.html
So, the examples on README won't actually show a working pub-sub cycle that actually works, that is a little bit confusing.