so I'm working on a Project using RabbitMq and Python 3.7. I first used Pika but then I switched to rabbitpy since it's Thread safe and we are using Multithreading in the Project. I looked at the Documentation of rabbitpy and I really like the API, so last Time I added the Mandatory publishing Feature to the Project but something interesting has happened.
when I Make a Subscription and then publish a msg, things works perfectly. that means if the Consumer Queue was already declared before publishing then it works great but if I tried to publish before making Subscription rabbitpy throw this Exception: NO_ROUTE(312)
before I added the Mandatory=True
argument all was working fine for me. So I don't understand what is happening under the Hood and to be honest the rabbitpy Docs is not the best and not many People are using it in their Project that's why there is not many Example on it in the internet. that's why I hope someone already had this and fixed it somehow. I know that I can easily remove the Mandatory argument and then all will work good but I liked the Idea of the Mandatory Publishing since it will indicate whether Rabbitmq has received the published msg or not and so I can monitor my messages through it. Now that's what I understand from the docs but as I mentionned the Docs of rabbitpy are not very well explained (at least to me) so if someone have some Opinion or understanding of the Mandatory Publishing and also the Immediate argument It will make my Day better to hear any Explanation. here is a link of the Docs where it is mentionned rabbitpy_mandatory . The Code Example I'm using is basically the same as the Code in the Docs that's why I will not add some Code and confuse things.
PS: another Information that may help debugging the Problem is that I'm using Multithreading. So I'm making a rabbitpy Connection object in the Main and then I'm assigning a independant Channel to every Thread. so the Threads share the Connection but not the Channels. that should be No Problem since it worked for me already before using the Mandatory publishing but I'm adding it only as an Information, maybe it will help at the end