{"action":"created","issue":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/628","repository_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ","labels_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/628/labels{/name}","comments_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/628/comments","events_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/628/events","html_url":"https://github.com/EasyNetQ/EasyNetQ/pull/628","id":187540569,"number":628,"title":"New feature: Multiple queue consume with single Model (Channel)","user":{"login":"stevenxi","id":3340119,"avatar_url":"https://avatars.githubusercontent.com/u/3340119?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenxi","html_url":"https://github.com/stevenxi","followers_url":"https://api.github.com/users/stevenxi/followers","following_url":"https://api.github.com/users/stevenxi/following{/other_user}","gists_url":"https://api.github.com/users/stevenxi/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenxi/subscriptions","organizations_url":"https://api.github.com/users/stevenxi/orgs","repos_url":"https://api.github.com/users/stevenxi/repos","events_url":"https://api.github.com/users/stevenxi/events{/privacy}","received_events_url":"https://api.github.com/users/stevenxi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-06T04:05:43Z","updated_at":"2016-11-06T10:03:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/pulls/628","html_url":"https://github.com/EasyNetQ/EasyNetQ/pull/628","diff_url":"https://github.com/EasyNetQ/EasyNetQ/pull/628.diff","patch_url":"https://github.com/EasyNetQ/EasyNetQ/pull/628.patch"},"body":"Added this new feature to meet a special need in my project.  \r\nI think it could be useful:\r\nMy project is to have the service handle multiple different type of request from different queues.  Each request may take few seconds to minute to process, so it's long processing.\r\nBecause each task's processing consumes lots of CPU resource, I wouldn't want too many of tasks being processed same time. So there's a limit on concurrent number of threads.\r\n\r\nSo the issue is, for each queue, there's one prefetch count, controls it's own prefetch number.\r\n\r\nSo I've added this multiple queue consume feature, allow multiple queue share one prefetch number by using the global = true flag.\r\n\r\nIt also handles priority automatic, the order of queue-consumer pair is the priority order.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/comments/258671020","html_url":"https://github.com/EasyNetQ/EasyNetQ/pull/628#issuecomment-258671020","issue_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/628","id":258671020,"user":{"login":"reisenberger","id":9608723,"avatar_url":"https://avatars.githubusercontent.com/u/9608723?v=3","gravatar_id":"","url":"https://api.github.com/users/reisenberger","html_url":"https://github.com/reisenberger","followers_url":"https://api.github.com/users/reisenberger/followers","following_url":"https://api.github.com/users/reisenberger/following{/other_user}","gists_url":"https://api.github.com/users/reisenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/reisenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisenberger/subscriptions","organizations_url":"https://api.github.com/users/reisenberger/orgs","repos_url":"https://api.github.com/users/reisenberger/repos","events_url":"https://api.github.com/users/reisenberger/events{/privacy}","received_events_url":"https://api.github.com/users/reisenberger/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T10:03:08Z","updated_at":"2016-11-06T10:03:08Z","body":"@stevenxi That makes sense!  If I've understood rightly: Since your tasks are long-running, you don't want any pre-fetched but not actioned, so that you can load-balance to other consumer instances.  So you share the pre-fetch count across the multiple consumers in the same channel (with the [global flag](http://www.rabbitmq.com/consumer-prefetch.html)), to ensure that doesn't happen. \r\n\r\n(In our case, the dynamics are different.  We want to limit parallelization when a batch process dumps several thousand messages into a queue.  And we want to prioritise other messages over that batch-processing, in real-time running.  But the processing time for each message is not as long-running as in your case; so having some/one of each message type pre-fetched is not a concern.)\r\n\r\nInterested to understand better: With pre-fetch count set to 1 across the whole channel, do you have a guarantee that RabbitMQ will send you what you consider as the higher-priority messages first?  Does the [RabbitMQ consumer priority](https://www.rabbitmq.com/consumer-priority.html) operate in this fashion, when you combine multiple consumers on the same channel?\r\n\r\n"}}
{"actor":{"display_login":"reisenberger"}}