corvus-ch / rabbitmq-cli-consumer

Consume RabbitMQ messages into any cli program
MIT License
236 stars 36 forks source link

Adding support for using multiple RabbitMQ channels per connection #77

Open bclougherty opened 4 years ago

bclougherty commented 4 years ago

This ticket is an alternate attempt to address #57 by using multiple RabbitMQ channels per connection. Since each channel runs in its own goroutine, the processors are also running concurrently. This allows control over the degree of concurrency by specifying a fixed number of channels to use for any given instance, while maintaining a single TCP connection to the server.

The default behavior is to use a single channel, which will give exactly the same result as the current version, Adding --num-channels X at the command line will open multiple channels. As long as the GOMAXPROCS env variable is at least X, this will allow running X concurrent processors handing messages from the queue.