<p>I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Customer A, another batch orders from Customer A, a third web or batch orders from Customer B, and so on.</p>

<p>My current solution is to assign separate queues to each customer\source combination. The process that puts orders into the queues has to make the right decision. My Windows Service can be configured to pull messages from one or more queues. It's messy, but it works.</p>

[{'answer_id': 64228, 'author': 'Esteban Araya', 'author_id': 781, 'author_profile': 'https://Stackoverflow.com/users/781', 'pm_score': 4, 'selected': True, 'text': '<p>No, but you can <strong>PEEK</strong> into the queue and decide if you really want to consume the message.</p>\n'}, {'answer_id': 2133312, 'author': 'Árpád Varga', 'author_id': 258533, 'author_profile': 'https://Stackoverflow.com/users/258533', 'pm_score': 2, 'selected': False, 'text': '<p>Use <em>GetMessageEnumerator2()</em> like this:</p>\n\n<pre><code>MessageEnumerator en = q.GetMessageEnumerator2();\n\nwhile (en.MoveNext())\n{\n    if (en.Current.Label == label)\n    {\n        string body = ((XmlDocument)en.Current.Body).OuterXml;\n        en.RemoveCurrent();\n        return body;\n    }\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/64204', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7668/']