You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby RabbitMQ libraries
Hi, all and Michael.
Will the the consumer started with block: true in separated thread block all others bunny consumers?
I drawing the schema now for a service with load like ~5 new
threads (=requests) in second and time to live from 10 to 600 seconds
for one thread.
Is this strategy ok for such service?
As I get so far for now:
One connection for program (microservice)
One channel and queue for the Thread
Queue will bind to topic (There are others microservices, that listens for the same routing keys as commands)
The channel must be closed (and the temporary queue will be deleted) when this Thread will close.
So it looks like there will be about 600 (pessimistic) simultaneous threads with every of them holding one consumer blocking that thread, and the same count of channels, queues, binds to one topic. Are there potentially places for memory leak? Like many binds/unbinds etc. Will they block each other?
Michael Klishin
unread,
Jun 30, 2019, 11:56:56 AM6/30/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby RabbitMQ libraries
block: true is never OK. It was added to use in tutorials to keep the main thread alive in case the app was only consuming, a decision I greatly regret now.
What it does is it blocks the *caller* (the calling thread) until the channel’s consumer work pool is active. It has no effect on any other consumers or the consumer dispatch mechanism, which is still entirely asynchronous.
To reiterate, consider Bunny::Queue#subscribe(block: true) to be NOT appropriate in ANY circumstances. I tried to eradicate it from all of the tutorials and docs recently. Let me know if it’s still present somewhere (in master, rabbitmq/rabbitmq-website, rabbitmq/rabbitmq-tutorials and so on).
Dimitri Pekarovsky:
Michael Klishin
unread,
Jun 30, 2019, 11:57:28 AM6/30/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby RabbitMQ libraries
block: true is never OK. It was added to use in tutorials to keep the main thread alive in case the app
was only consuming, a decision I greatly regret now.
What it does is it blocks the *caller* (the calling thread) until the channel’s consumer work pool is active.
It has no effect on any other consumers or the consumer dispatch mechanism, which is still entirely asynchronous.
To reiterate, consider Bunny::Queue#subscribe(block: true) to be NOT appropriate in ANY circumstances. I tried to eradicate it from all of the tutorials and docs recently. Let me know if it’s still present somewhere (in master, rabbitmq/rabbitmq-website, rabbitmq/rabbitmq-tutorials and so on).