{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/4","repository_url":"https://api.github.com/repos/Azure/azure-service-bus-samples","labels_url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/4/comments","events_url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/4/events","html_url":"https://github.com/Azure/azure-service-bus-samples/issues/4","id":188953811,"number":4,"title":"OnMessage + MaxConcurrentMessages vs ReciveBatch","user":{"login":"aL3891","id":2126346,"avatar_url":"https://avatars.githubusercontent.com/u/2126346?v=3","gravatar_id":"","url":"https://api.github.com/users/aL3891","html_url":"https://github.com/aL3891","followers_url":"https://api.github.com/users/aL3891/followers","following_url":"https://api.github.com/users/aL3891/following{/other_user}","gists_url":"https://api.github.com/users/aL3891/gists{/gist_id}","starred_url":"https://api.github.com/users/aL3891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aL3891/subscriptions","organizations_url":"https://api.github.com/users/aL3891/orgs","repos_url":"https://api.github.com/users/aL3891/repos","events_url":"https://api.github.com/users/aL3891/events{/privacy}","received_events_url":"https://api.github.com/users/aL3891/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-13T05:48:18Z","updated_at":"2016-11-13T13:15:32Z","closed_at":null,"body":"Hello, \r\nSorry if this is not the right place to ask this but i'm having some trouble getting messages to be processed in parallel when using the OnMessageAsync method. I've set the MaxConcurrentMessages and Prefetch values but I still see my OnMessage method being called serially.\r\n\r\nI am able to get the result I expect using the ReciveBatchAsync method but it feels like i'm replicating the functionality of OnMessage. Are there any other settings that are required for MaxConcurrentMessages to work? or are there any particular circumstances that causes OnMessage to process messages serially?  "},"comment":{"url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/comments/260185575","html_url":"https://github.com/Azure/azure-service-bus-samples/issues/4#issuecomment-260185575","issue_url":"https://api.github.com/repos/Azure/azure-service-bus-samples/issues/4","id":260185575,"user":{"login":"aL3891","id":2126346,"avatar_url":"https://avatars.githubusercontent.com/u/2126346?v=3","gravatar_id":"","url":"https://api.github.com/users/aL3891","html_url":"https://github.com/aL3891","followers_url":"https://api.github.com/users/aL3891/followers","following_url":"https://api.github.com/users/aL3891/following{/other_user}","gists_url":"https://api.github.com/users/aL3891/gists{/gist_id}","starred_url":"https://api.github.com/users/aL3891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aL3891/subscriptions","organizations_url":"https://api.github.com/users/aL3891/orgs","repos_url":"https://api.github.com/users/aL3891/repos","events_url":"https://api.github.com/users/aL3891/events{/privacy}","received_events_url":"https://api.github.com/users/aL3891/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T13:15:32Z","updated_at":"2016-11-13T13:15:32Z","body":"I think I understand what's going on now, basically the problem is message size. ReceiveBatch, either directly or from within OnMessage message pump will only retrieve as many messages as will fit inside the 64k limit for requests. Further, OnMessage only seems to parallelize messages that are actually available in the cache and not keep fetching more messages untile the cache is empty.\r\n\r\nSo in my case where only a few message fits inside the 64k limit, parallelism is limited. If instead I manually call ReceiveBatchAsync multiple times and not wait for completion unless i'm above the concurrency limit it works as I expected. \r\n\r\nI'd love to know if there is a way around this though"}}
{"actor":{"display_login":"aL3891"}}