{"action":"created","issue":{"url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/44","labels_url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/44/comments","events_url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/44/events","html_url":"https://github.com/Polyconseil/aioamqp/issues/44","id":104646737,"number":44,"title":"Ack messages with multiple connections","user":{"login":"thijsterlouw","id":126053,"avatar_url":"https://avatars.githubusercontent.com/u/126053?v=3","gravatar_id":"","url":"https://api.github.com/users/thijsterlouw","html_url":"https://github.com/thijsterlouw","followers_url":"https://api.github.com/users/thijsterlouw/followers","following_url":"https://api.github.com/users/thijsterlouw/following{/other_user}","gists_url":"https://api.github.com/users/thijsterlouw/gists{/gist_id}","starred_url":"https://api.github.com/users/thijsterlouw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thijsterlouw/subscriptions","organizations_url":"https://api.github.com/users/thijsterlouw/orgs","repos_url":"https://api.github.com/users/thijsterlouw/repos","events_url":"https://api.github.com/users/thijsterlouw/events{/privacy}","received_events_url":"https://api.github.com/users/thijsterlouw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Polyconseil/aioamqp/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-03T08:31:21Z","updated_at":"2015-12-15T07:20:45Z","closed_at":null,"body":"Usecase: my Python application is connecting to multiple RabbitMQ servers. These are non-clustered. Our events are sharded across these servers. We want to consume events from all these servers. These events need to be ack'ed.\r\n\r\nProblem: \r\n```channel.basic_consume(queue_name, callback=callback)``` \r\ncallback looks like:\r\n```def callback(body, envelope, properties):```\r\nthus inside the callback you have no idea from which server you received the event. \r\nTicket https://github.com/Polyconseil/aioamqp/issues/39 suggests creating a separate channel to ack. Problem I don't know which server to create the channel for.\r\n\r\nInitially I thought I just create a lambda for the callback and bind the ack-channel, but then I found:\r\nhttps://github.com/Polyconseil/aioamqp/commit/ff74ee7359910dd4647be58f11499e159549ce7a\r\nSo that's probably not going to work out. Wonder why this change was made anyway.\r\n\r\nI'm pretty new to Python, so I am not sure what I'm supposed to do in this case. Should I wrap these functions in objects and can the callback function point to a member-function of the object? The object would then have access to the server/channel, thus we're able to send an ack."},"comment":{"url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/comments/164668117","html_url":"https://github.com/Polyconseil/aioamqp/issues/44#issuecomment-164668117","issue_url":"https://api.github.com/repos/Polyconseil/aioamqp/issues/44","id":164668117,"user":{"login":"dzen","id":50241,"avatar_url":"https://avatars.githubusercontent.com/u/50241?v=3","gravatar_id":"","url":"https://api.github.com/users/dzen","html_url":"https://github.com/dzen","followers_url":"https://api.github.com/users/dzen/followers","following_url":"https://api.github.com/users/dzen/following{/other_user}","gists_url":"https://api.github.com/users/dzen/gists{/gist_id}","starred_url":"https://api.github.com/users/dzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzen/subscriptions","organizations_url":"https://api.github.com/users/dzen/orgs","repos_url":"https://api.github.com/users/dzen/repos","events_url":"https://api.github.com/users/dzen/events{/privacy}","received_events_url":"https://api.github.com/users/dzen/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T07:20:45Z","updated_at":"2015-12-15T07:20:45Z","body":"hello @thijsterlouw . Did you try the latest release ? (0.5.1, since we got a packaging problem) ?"}}