{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-amqp/bunny/issues/545","repository_url":"https://api.github.com/repos/ruby-amqp/bunny","labels_url":"https://api.github.com/repos/ruby-amqp/bunny/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/ruby-amqp/bunny/issues/545/comments","events_url":"https://api.github.com/repos/ruby-amqp/bunny/issues/545/events","html_url":"https://github.com/ruby-amqp/bunny/issues/545","id":304308018,"number":545,"title":"Channel#nack requeue option ignored","user":{"login":"JulienAmoros","id":17905578,"avatar_url":"https://avatars0.githubusercontent.com/u/17905578?v=4","gravatar_id":"","url":"https://api.github.com/users/JulienAmoros","html_url":"https://github.com/JulienAmoros","followers_url":"https://api.github.com/users/JulienAmoros/followers","following_url":"https://api.github.com/users/JulienAmoros/following{/other_user}","gists_url":"https://api.github.com/users/JulienAmoros/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienAmoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienAmoros/subscriptions","organizations_url":"https://api.github.com/users/JulienAmoros/orgs","repos_url":"https://api.github.com/users/JulienAmoros/repos","events_url":"https://api.github.com/users/JulienAmoros/events{/privacy}","received_events_url":"https://api.github.com/users/JulienAmoros/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-12T10:07:06Z","updated_at":"2018-03-12T16:24:05Z","closed_at":"2018-03-12T15:52:14Z","author_association":"NONE","body":"## Nack requeue option ignored\r\n\r\nHi everyone!\r\nIt seems like re-queuing on `Channel#nack` through `requeue: true` is ignored. \r\n`channel.nack(_delivery_info.delivery_tag, requeue: true)`\r\nThis doesn't seems to be proper behavior, do you have the same issue or did I miss anything?\r\n\r\n * I use docker container for RabbitMQ with management plugin\r\n * Bunny version: 2.9.2\r\n * Last RabbitMQ logs (not sure it's relevant though), obtained from `docker logs my-rabbit`\r\n`2018-03-12 09:48:36.574 [info] <0.3238.0> accepting AMQP connection <0.3238.0> (172.17.0.1:57616 -> 172.17.0.2:5672)`\r\n`2018-03-12 09:48:36.576 [info] <0.3238.0> connection <0.3238.0> (172.17.0.1:57616 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'`\r\n`2018-03-12 09:48:38.903 [info] <0.3250.0> accepting AMQP connection <0.3250.0> (172.17.0.1:57618 -> 172.17.0.2:5672)`\r\n`2018-03-12 09:48:38.916 [info] <0.3250.0> connection <0.3250.0> (172.17.0.1:57618 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'`\r\n`2018-03-12 09:48:42.351 [info] <0.3264.0> accepting AMQP connection <0.3264.0> (172.17.0.1:57620 -> 172.17.0.2:5672)`\r\n`2018-03-12 09:48:42.353 [info] <0.3264.0> connection <0.3264.0> (172.17.0.1:57620 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'`\r\n`2018-03-12 09:48:42.355 [info] <0.3264.0> closing AMQP connection <0.3264.0> (172.17.0.1:57620 -> 172.17.0.2:5672, vhost: '/', user: 'guest')`\r\n`2018-03-12 09:48:46.117 [info] <0.3238.0> closing AMQP connection <0.3238.0> (172.17.0.1:57616 -> 172.17.0.2:5672, vhost: '/', user: 'guest')`\r\n * No Exception raised\r\n * Steps to reproduce or a failing test case:\r\n1. Start RabbitMQ docker: `docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 rabbitmq:3-management`\r\n2. `ruby manual_nack_consumer.rb` (see below)\r\n3. `ruby manual_ack_consumer.rb` (see below)\r\n4. `ruby manual_producer.rb` (see below)\r\n\r\nCode:\r\n```ruby\r\n# manual_producer.rb\r\nrequire 'bunny'\r\n\r\nconnection = Bunny.new(hostname: '172.17.0.2')\r\nconnection.start\r\nchannel = connection.create_channel\r\nqueue = channel.queue('man_ack')\r\n\r\nchannel.default_exchange.publish('Hello World.....', routing_key: queue.name)\r\nputs \" [x] Sent 'Hello World!'\"\r\n\r\nconnection.close\r\n\r\n\r\n# manual_ack_consumer.rb\r\nrequire 'bunny'\r\n\r\nconnection = Bunny.new(hostname:  '172.17.0.2')\r\nconnection.start\r\nchannel = connection.create_channel\r\nchannel.prefetch(1)\r\nqueue = channel.queue('man_ack')\r\n\r\nbegin\r\n  puts ' [*] Waiting for messages. To exit press CTRL+C'\r\n  queue.subscribe(block: true, manual_ack: true) do |_delivery_info, _properties, body|\r\n    puts \" [x] Processing #{body} (#{_delivery_info.delivery_tag})\"\r\n    sleep body.count('.')\r\n    channel.ack(_delivery_info.delivery_tag)\r\n    puts \" [x] Processing over (#{_delivery_info.delivery_tag})\"\r\n  end\r\nrescue Interrupt => _\r\n  connection.close\r\n  exit(0)\r\nend\r\n\r\n\r\n# manual_nack_consumer.rb\r\nrequire 'bunny'\r\n\r\nconnection = Bunny.new(hostname:  '172.17.0.2')\r\nconnection.start\r\nchannel = connection.create_channel\r\nchannel.prefetch(1)\r\nqueue = channel.queue('man_ack')\r\n\r\nbegin\r\n  puts ' [*] Waiting for messages. To exit press CTRL+C'\r\n  queue.subscribe(block: true, manual_ack: true) do |_delivery_info, _properties, body|\r\n    puts \" [x] Processing #{body} (#{_delivery_info.delivery_tag})\"\r\n    channel.nack(_delivery_info.delivery_tag, requeue: true)\r\n    puts 'Job failed'\r\n  end\r\nrescue Interrupt => _\r\n  connection.close\r\n  exit(0)\r\nend\r\n```\r\n\r\nSide note: requeuing works properly to me when using `Channel#reject` with same arguments.\r\n\r\nRegards :-)\r\n"},"comment":{"url":"https://api.github.com/repos/ruby-amqp/bunny/issues/comments/372370955","html_url":"https://github.com/ruby-amqp/bunny/issues/545#issuecomment-372370955","issue_url":"https://api.github.com/repos/ruby-amqp/bunny/issues/545","id":372370955,"user":{"login":"JulienAmoros","id":17905578,"avatar_url":"https://avatars0.githubusercontent.com/u/17905578?v=4","gravatar_id":"","url":"https://api.github.com/users/JulienAmoros","html_url":"https://github.com/JulienAmoros","followers_url":"https://api.github.com/users/JulienAmoros/followers","following_url":"https://api.github.com/users/JulienAmoros/following{/other_user}","gists_url":"https://api.github.com/users/JulienAmoros/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienAmoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienAmoros/subscriptions","organizations_url":"https://api.github.com/users/JulienAmoros/orgs","repos_url":"https://api.github.com/users/JulienAmoros/repos","events_url":"https://api.github.com/users/JulienAmoros/events{/privacy}","received_events_url":"https://api.github.com/users/JulienAmoros/received_events","type":"User","site_admin":false},"created_at":"2018-03-12T16:24:05Z","updated_at":"2018-03-12T16:24:05Z","author_association":"NONE","body":"You're right, I didn't get that point at the moment, thanks for your answer!"}}
{"actor":{"display_login":"JulienAmoros"}}