I have a scenario where one producer publishes a stream of messages to an exchange. The exchange has 10 queues (there is an upper limit to the amount of parallel work that can be done - e.g. Database bottleneck) that it routes messages to. The messages can really go to any queue with one exception: only one message with a given user id can be processed at a time. <div>
<br></div><div>All messages with that user id should be routed to the same queue. If there was no database bottleneck I would create a new queue for each user id but I can really only process ten messages at a time. </div>
<div><br></div><div>I had thought of partitioning the user ids across ten queues but there is no guarantee the incoming messages would be evenly distributed even with different user ids. Thus I could have queues 1,4 and 8 with a backlog while the rest are idle resources. </div>
<div><br></div><div>Any tips on a defined pattern that solves this type of problem so that any message for a given user id can go to any queue but messages with the same user id always go to the same queue?</div><div><br>
</div><div>-Sean</div>