Hello everyone,
I'm entirely new to RabbitMQ (I used Amazon SQS previously) and would like some clarifications.
I read some topics in the group and these are the information I gathered:
- Share Bunny connection per process (after forking), if I have 2 processes, I'll have 2 connections (one per process)
- One channel per thread. So if I have 4 threads and 2 processes, I'll need to have 8 channels ? I'm not completely sure about this
- There is no need for "connection pooling", one connection per process is enough
- What options do I have to create a channel for each thread, since Puma doesn't expose any API for when threads are created?
- What options do I have to ensure channels are closed when a thread dies/exits normally?
- Are channels automatically closed if the thread where they are in use die/exits normally?
I have a main web application which is just going to publish messages to a single queue, and a completely different application which is going to digest these messages.
From my understanding, both creating a connection and creating a channel are heavy operations. I need my web requests to be extremely fast (that's the main purpose of using rabbitmq) write-wise, so I need some suggestions regarding how to keep the channel and the connection open and keep using those and close only when the application is quitting or crashing.