Opening Channels not working with AsyncioConnection

54 views
Skip to first unread message

Leon Lux

unread,
Jul 16, 2024, 1:13:06 PM7/16/24
to Pika
Hello there, I am new to RabbitMQ and Pika, so please forgive if I'm making a blatant mistake.

I am encountering a weird Problem when trying to create a new Channel after starting the ioloop where the connection.channel() call gets registered by the ioloop, but no RPC is sent no matter how long I wait. I suspect that I'm blocking the ioloop without knowing it.


The idea behind the code is that users of the client can dynamically start consuming
queues by calling subscribe(), which creates a consumer with a dedicated channel that then starts consuming the queue. The problem happens when subscribe() is called a second time. Debug Output shows that the callback for successful channel opening is being registered, but the RPC to actually open it is never issued, instead the ioloop seemingly blocks forever.

Would be very happy if someone could point me in the right direction!

Thanks in Advance.

Gavin M. Roy

unread,
Jul 16, 2024, 9:43:13 PM7/16/24
to pika-...@googlegroups.com
It may have something to do with your using threads, which I'd avoid, especially since you're using asyncio. There's an equivalent of what you're doing with run_forever with the asyncio loop. I'd replace all your threading related things with asyncio things.

--
You received this message because you are subscribed to the Google Groups "Pika" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pika-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pika-python/08b40dc2-8bc0-4ab1-90bd-aa772c174830n%40googlegroups.com.

leo...@icloud.com

unread,
Jul 17, 2024, 2:01:37 AM7/17/24
to pika-...@googlegroups.com
Im suspecting the same, I already played around with different connection Adapters like SelectConnection, but they all behave the same.

When I port everything to async, is it still possible to make the Application mostly synchronous? The Code I provided is part of a bigger project which is not using asyncio. The RabbitMQ Client should be the only asynchronous part of the Application
You received this message because you are subscribed to a topic in the Google Groups "Pika" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pika-python/52tjlx1RZj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pika-python...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pika-python/CAPnH5kqMX8FBavrqXv%2Bxi5maFfCtoGK-rgOTTkswuJrjA9Tnaw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages