Skip to content

Connection and Channels best practices? #120

Answered by Zerpet
mgdotson asked this question in Q&A
Discussion options

You must be logged in to vote

Generally, the best practice is to have long-lived connections and create new channels as needed. It also important to not use the same channel by multiple threads; instead, use one channel per thread/go-routine.

Another common pitfall is to use the same channel to publish and consume. It's best advised to use separate channels for consumption and publishing, because RabbitMQ may block a publisher channel due to an alarm (e.g. high memory usage), if consumers are using this channel, they will be blocked as well.

I recommend to have a look at the production check list, the apps section: https://rabbitmq.com/production-checklist.html#apps
This covers important topics, like connection/channe…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mgdotson
Comment options

@Zerpet
Comment options

Answer selected by mgdotson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants