{"action":"created","comment":{"url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/comments/27580530","id":27580530,"diff_hunk":"@@ -51,17 +57,17 @@ object ChannelOwner {\n           def handleFlow(active: Boolean): Unit = listener ! HandleFlow(active)\n         }))\n       }\n-      case request@Publish(exchange, routingKey, body, properties, mandatory, immediate) => {\n+      case request: Publish => {\n         log.debug(\"publishing %s\".format(request))\n-        val props = properties getOrElse new AMQP.BasicProperties.Builder().build()\n-        sender ! withChannel(channel, request)(c => c.basicPublish(exchange, routingKey, mandatory, immediate, props, body))\n+        sender ! withChannel(channel, request)(c => publishAndReturnSeqNo(c, request))\n       }\n       case request@Transaction(publish) => {\n         sender ! withChannel(channel, request) {\n           c => {\n             c.txSelect()\n-            publish.foreach(p => c.basicPublish(p.exchange, p.key, p.mandatory, p.immediate, p.properties getOrElse new AMQP.BasicProperties.Builder().build(), p.body))\n+            val seqNos = publish.map(p => publishAndReturnSeqNo(c, p))","path":"src/main/scala/com/github.sstone/amqp/ChannelOwner.scala","position":29,"original_position":29,"commit_id":"ab17f0da58a9ae124827f1e7145d0d89985e1d6a","original_commit_id":"ab17f0da58a9ae124827f1e7145d0d89985e1d6a","user":{"login":"stratiator","id":2676848,"avatar_url":"https://avatars.githubusercontent.com/u/2676848?v=3","gravatar_id":"","url":"https://api.github.com/users/stratiator","html_url":"https://github.com/stratiator","followers_url":"https://api.github.com/users/stratiator/followers","following_url":"https://api.github.com/users/stratiator/following{/other_user}","gists_url":"https://api.github.com/users/stratiator/gists{/gist_id}","starred_url":"https://api.github.com/users/stratiator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratiator/subscriptions","organizations_url":"https://api.github.com/users/stratiator/orgs","repos_url":"https://api.github.com/users/stratiator/repos","events_url":"https://api.github.com/users/stratiator/events{/privacy}","received_events_url":"https://api.github.com/users/stratiator/received_events","type":"User","site_admin":false},"body":"```scala\r\n[ERROR] [04/01/2015 17:32:17.888] [application-akka.actor.default-dispatcher-4] [akka://application/user/$a/$a] shutdown\r\ncom.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - cannot switch from confirm to tx mode, class-id=90, method-id=10)\r\n\tat com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:478)\r\n\tat com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:315)\r\n\tat com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:144)\r\n\tat com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:91)\r\n\tat com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:550)\r\n\tat java.lang.Thread.run(Thread.java:745)```\r\n\r\nSo the only way it won't fail when you are not in confirm select mode, which way you'll get back a set of zeros","created_at":"2015-04-01T15:33:24Z","updated_at":"2015-04-01T15:33:24Z","html_url":"https://github.com/gawkermedia/amqp-client/pull/1#discussion_r27580530","pull_request_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/comments/27580530"},"html":{"href":"https://github.com/gawkermedia/amqp-client/pull/1#discussion_r27580530"},"pull_request":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1","id":32422443,"html_url":"https://github.com/gawkermedia/amqp-client/pull/1","diff_url":"https://github.com/gawkermedia/amqp-client/pull/1.diff","patch_url":"https://github.com/gawkermedia/amqp-client/pull/1.patch","issue_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/1","number":1,"state":"open","locked":false,"title":"Return seq numbers for Publish and Transaction","user":{"login":"leventem","id":10024983,"avatar_url":"https://avatars.githubusercontent.com/u/10024983?v=3","gravatar_id":"","url":"https://api.github.com/users/leventem","html_url":"https://github.com/leventem","followers_url":"https://api.github.com/users/leventem/followers","following_url":"https://api.github.com/users/leventem/following{/other_user}","gists_url":"https://api.github.com/users/leventem/gists{/gist_id}","starred_url":"https://api.github.com/users/leventem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leventem/subscriptions","organizations_url":"https://api.github.com/users/leventem/orgs","repos_url":"https://api.github.com/users/leventem/repos","events_url":"https://api.github.com/users/leventem/events{/privacy}","received_events_url":"https://api.github.com/users/leventem/received_events","type":"User","site_admin":false},"body":"### What does this PR do? How does it affect users?\r\nWhen receiving an Publish or Transaction message (list of Publishes), return the (list of) sequence number(s) so that we can store it on the client side until the confirmation arrives.\r\n\r\n### How should this be tested (feature switches, URLs, special user permissions)?\r\nWhen switching the producer part to use \"ask\", we can check the content of the returned OK message.\r\n\r\n### Related Trello card, wiki page or blog posts\r\nhttps://trello.com/c/Il7iSgAt/323-configure-and-use-rabbitmq-in-linksupportservice\r\n\r\n@privateblue @stratiator please take a look","created_at":"2015-04-01T14:11:45Z","updated_at":"2015-04-01T15:33:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b95dfc24c9a12273a7dac84b0f0bb1cd25a202e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1/commits","review_comments_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1/comments","review_comment_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/1/comments","statuses_url":"https://api.github.com/repos/gawkermedia/amqp-client/statuses/ab17f0da58a9ae124827f1e7145d0d89985e1d6a","head":{"label":"gawkermedia:return-seq-no","ref":"return-seq-no","sha":"ab17f0da58a9ae124827f1e7145d0d89985e1d6a","user":{"login":"gawkermedia","id":852924,"avatar_url":"https://avatars.githubusercontent.com/u/852924?v=3","gravatar_id":"","url":"https://api.github.com/users/gawkermedia","html_url":"https://github.com/gawkermedia","followers_url":"https://api.github.com/users/gawkermedia/followers","following_url":"https://api.github.com/users/gawkermedia/following{/other_user}","gists_url":"https://api.github.com/users/gawkermedia/gists{/gist_id}","starred_url":"https://api.github.com/users/gawkermedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawkermedia/subscriptions","organizations_url":"https://api.github.com/users/gawkermedia/orgs","repos_url":"https://api.github.com/users/gawkermedia/repos","events_url":"https://api.github.com/users/gawkermedia/events{/privacy}","received_events_url":"https://api.github.com/users/gawkermedia/received_events","type":"Organization","site_admin":false},"repo":{"id":32338520,"name":"amqp-client","full_name":"gawkermedia/amqp-client","owner":{"login":"gawkermedia","id":852924,"avatar_url":"https://avatars.githubusercontent.com/u/852924?v=3","gravatar_id":"","url":"https://api.github.com/users/gawkermedia","html_url":"https://github.com/gawkermedia","followers_url":"https://api.github.com/users/gawkermedia/followers","following_url":"https://api.github.com/users/gawkermedia/following{/other_user}","gists_url":"https://api.github.com/users/gawkermedia/gists{/gist_id}","starred_url":"https://api.github.com/users/gawkermedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawkermedia/subscriptions","organizations_url":"https://api.github.com/users/gawkermedia/orgs","repos_url":"https://api.github.com/users/gawkermedia/repos","events_url":"https://api.github.com/users/gawkermedia/events{/privacy}","received_events_url":"https://api.github.com/users/gawkermedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gawkermedia/amqp-client","description":"Simple fault-tolerant AMQP client written in Scala and based on Akka and the RabbitMQ java client","fork":true,"url":"https://api.github.com/repos/gawkermedia/amqp-client","forks_url":"https://api.github.com/repos/gawkermedia/amqp-client/forks","keys_url":"https://api.github.com/repos/gawkermedia/amqp-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gawkermedia/amqp-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gawkermedia/amqp-client/teams","hooks_url":"https://api.github.com/repos/gawkermedia/amqp-client/hooks","issue_events_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/events{/number}","events_url":"https://api.github.com/repos/gawkermedia/amqp-client/events","assignees_url":"https://api.github.com/repos/gawkermedia/amqp-client/assignees{/user}","branches_url":"https://api.github.com/repos/gawkermedia/amqp-client/branches{/branch}","tags_url":"https://api.github.com/repos/gawkermedia/amqp-client/tags","blobs_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gawkermedia/amqp-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gawkermedia/amqp-client/languages","stargazers_url":"https://api.github.com/repos/gawkermedia/amqp-client/stargazers","contributors_url":"https://api.github.com/repos/gawkermedia/amqp-client/contributors","subscribers_url":"https://api.github.com/repos/gawkermedia/amqp-client/subscribers","subscription_url":"https://api.github.com/repos/gawkermedia/amqp-client/subscription","commits_url":"https://api.github.com/repos/gawkermedia/amqp-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gawkermedia/amqp-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gawkermedia/amqp-client/contents/{+path}","compare_url":"https://api.github.com/repos/gawkermedia/amqp-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gawkermedia/amqp-client/merges","archive_url":"https://api.github.com/repos/gawkermedia/amqp-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gawkermedia/amqp-client/downloads","issues_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues{/number}","pulls_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gawkermedia/amqp-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gawkermedia/amqp-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gawkermedia/amqp-client/labels{/name}","releases_url":"https://api.github.com/repos/gawkermedia/amqp-client/releases{/id}","created_at":"2015-03-16T16:35:48Z","updated_at":"2015-03-16T16:35:49Z","pushed_at":"2015-04-01T14:11:45Z","git_url":"git://github.com/gawkermedia/amqp-client.git","ssh_url":"git@github.com:gawkermedia/amqp-client.git","clone_url":"https://github.com/gawkermedia/amqp-client.git","svn_url":"https://github.com/gawkermedia/amqp-client","homepage":"","size":384,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"scala2.10_kinja"}},"base":{"label":"gawkermedia:scala2.10_kinja","ref":"scala2.10_kinja","sha":"d49f6e6f4cc64a467cd380e51b4a9691eef6489c","user":{"login":"gawkermedia","id":852924,"avatar_url":"https://avatars.githubusercontent.com/u/852924?v=3","gravatar_id":"","url":"https://api.github.com/users/gawkermedia","html_url":"https://github.com/gawkermedia","followers_url":"https://api.github.com/users/gawkermedia/followers","following_url":"https://api.github.com/users/gawkermedia/following{/other_user}","gists_url":"https://api.github.com/users/gawkermedia/gists{/gist_id}","starred_url":"https://api.github.com/users/gawkermedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawkermedia/subscriptions","organizations_url":"https://api.github.com/users/gawkermedia/orgs","repos_url":"https://api.github.com/users/gawkermedia/repos","events_url":"https://api.github.com/users/gawkermedia/events{/privacy}","received_events_url":"https://api.github.com/users/gawkermedia/received_events","type":"Organization","site_admin":false},"repo":{"id":32338520,"name":"amqp-client","full_name":"gawkermedia/amqp-client","owner":{"login":"gawkermedia","id":852924,"avatar_url":"https://avatars.githubusercontent.com/u/852924?v=3","gravatar_id":"","url":"https://api.github.com/users/gawkermedia","html_url":"https://github.com/gawkermedia","followers_url":"https://api.github.com/users/gawkermedia/followers","following_url":"https://api.github.com/users/gawkermedia/following{/other_user}","gists_url":"https://api.github.com/users/gawkermedia/gists{/gist_id}","starred_url":"https://api.github.com/users/gawkermedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gawkermedia/subscriptions","organizations_url":"https://api.github.com/users/gawkermedia/orgs","repos_url":"https://api.github.com/users/gawkermedia/repos","events_url":"https://api.github.com/users/gawkermedia/events{/privacy}","received_events_url":"https://api.github.com/users/gawkermedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gawkermedia/amqp-client","description":"Simple fault-tolerant AMQP client written in Scala and based on Akka and the RabbitMQ java client","fork":true,"url":"https://api.github.com/repos/gawkermedia/amqp-client","forks_url":"https://api.github.com/repos/gawkermedia/amqp-client/forks","keys_url":"https://api.github.com/repos/gawkermedia/amqp-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gawkermedia/amqp-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gawkermedia/amqp-client/teams","hooks_url":"https://api.github.com/repos/gawkermedia/amqp-client/hooks","issue_events_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/events{/number}","events_url":"https://api.github.com/repos/gawkermedia/amqp-client/events","assignees_url":"https://api.github.com/repos/gawkermedia/amqp-client/assignees{/user}","branches_url":"https://api.github.com/repos/gawkermedia/amqp-client/branches{/branch}","tags_url":"https://api.github.com/repos/gawkermedia/amqp-client/tags","blobs_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gawkermedia/amqp-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gawkermedia/amqp-client/languages","stargazers_url":"https://api.github.com/repos/gawkermedia/amqp-client/stargazers","contributors_url":"https://api.github.com/repos/gawkermedia/amqp-client/contributors","subscribers_url":"https://api.github.com/repos/gawkermedia/amqp-client/subscribers","subscription_url":"https://api.github.com/repos/gawkermedia/amqp-client/subscription","commits_url":"https://api.github.com/repos/gawkermedia/amqp-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gawkermedia/amqp-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gawkermedia/amqp-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gawkermedia/amqp-client/contents/{+path}","compare_url":"https://api.github.com/repos/gawkermedia/amqp-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gawkermedia/amqp-client/merges","archive_url":"https://api.github.com/repos/gawkermedia/amqp-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gawkermedia/amqp-client/downloads","issues_url":"https://api.github.com/repos/gawkermedia/amqp-client/issues{/number}","pulls_url":"https://api.github.com/repos/gawkermedia/amqp-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gawkermedia/amqp-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gawkermedia/amqp-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gawkermedia/amqp-client/labels{/name}","releases_url":"https://api.github.com/repos/gawkermedia/amqp-client/releases{/id}","created_at":"2015-03-16T16:35:48Z","updated_at":"2015-03-16T16:35:49Z","pushed_at":"2015-04-01T14:11:45Z","git_url":"git://github.com/gawkermedia/amqp-client.git","ssh_url":"git@github.com:gawkermedia/amqp-client.git","clone_url":"https://github.com/gawkermedia/amqp-client.git","svn_url":"https://github.com/gawkermedia/amqp-client","homepage":"","size":384,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"scala2.10_kinja"}},"_links":{"self":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1"},"html":{"href":"https://github.com/gawkermedia/amqp-client/pull/1"},"issue":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/issues/1"},"comments":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/gawkermedia/amqp-client/statuses/ab17f0da58a9ae124827f1e7145d0d89985e1d6a"}}}}