0

Just need an opinion. Is it a good practice to use same rabbit connection to subscribe the message and send commands internally as well.

Scenario is :
We have a subscriber application that has handlers. But some processes are long running to make it more resilient we want to send internal commands.

Question :- Can we use the same connection to send commands to rabbitmq.

Note: We are using RabbitMQ connection as singleton. Around 340K message we will receives in a day and have only 2 instances of this application.

Thanks in advance.

user2266837
  • 587
  • 2
  • 5
  • 12
  • 1
    I recommend one connection per vhost to consume, and one connection per vhost to publish. Rabbit (AMQP 0-9-1) itself uses/supports multiple *channels* within each connection. – user2864740 May 08 '20 at 09:50
  • Anyway, sending a “command” via RMQ is still done via some queue mechanism; and it’s possible for multiple consumers to run concurrently. Avoiding the “blocking” then ultimately comes down to separating the data into different queues (including direct queue routing) - the connection itself is *not* blocked, as each channel (~consumer) is separate. – user2864740 May 08 '20 at 09:56

0 Answers0