Pergunta

I have an app in which for each received message it publishes N in the same channel. I'm wondering whether it'd be better to have two channel, a Publish channel and a Receive channel.

What would it be the best practice?

Foi útil?

Solução

Best practice is to have one channel per consumer/ queue. I would say that would extend to publishing on a different channel as consuming.

Outras dicas

To add to the above answer, channels are essentially cost-free. A "channel" in RabbitMQ is just an integer that is tacked on to the raw packet indicating what channel it is for. The underlying TCP stream is still the same. There is a negligible additional amount of resources consumed by keeping track of all the different channels on the client and server side, but this is really only a problem if you are creating close to the maximum number of channels.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top