title: How to achieve round-robin topic exchange in RabbitMQ
body: <p>I know that achieving round-robin behaviour in a topic exchange can be tricky or impossible so my question in fact is if there is anything I can make out of RabbitMQ or look away to other message queues that support that.</p>
  
  <p>Here's a detailed explanation of my application requirements:</p>
  
  <ol>
  <li>There will be one producer, let's call it <code>P</code></li>
  <li>There (potentially) will be thousands of consumers, let's call them <code>Cn</code></li>
  <li>Each consumer can "subscribe" to 1 or more topic exchange and multiple consumers can be subscribed to the same topic</li>
  <li>Every message published into the topic should be consumed by only ONE consumer</li>
  </ol>
  
  <p><strong>Use case #1</strong></p>
  
  <p>Assume:</p>
  
  <p><em>Topics</em></p>
  
  <ul>
  <li><code>foo.bar</code></li>
  <li><code>foo.baz</code></li>
  </ul>
  
  <p><em>Consumers</em> </p>
  
  <ul>
  <li>Consumer <code>C1</code> is subscribed to topic <code>#</code></li>
  <li>Consumer <code>C2</code> is subscribed to topic <code>foo.*</code></li>
  <li>Consumer <code>C3</code> is subscribed to topic <code>*.bar</code></li>
  </ul>
  
  <p>Producer <code>P</code> publishes the following messages:</p>
  
  <ol>
  <li>publish <code>foo.qux</code>: <code>C1</code> and <code>C2</code> can potentially consume this message but only one receives it</li>
  <li>publish <code>foo.bar</code>: <code>C1</code>, <code>C2</code> and <code>C3</code> can potentially consume this message but only one receives it</li>
  </ol>
  
  <p><em>Note</em>
  Unfortunately I can't have a separate queue for each "topic" therefore using the <code>Direct Exchange</code> doesn't work since the number of topic combinations can be huge (tens of thousands)</p>
  
  <p>From what I've read, there is no out-of-the box solution with RabbitMQ. Does anybody know a workaround or there's another message queue solution that would support this, ex. Kafka, Kinesis etc.</p>
  
  <p>Thank you</p>