{"action":"created","issue":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/52","repository_url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange","labels_url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/52/comments","events_url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/52/events","html_url":"https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/issues/52","id":156873114,"number":52,"title":"nack/reject message to 'x-delayed-message' exchange with given delay time works only for first message","user":{"login":"srkimir","id":8228710,"avatar_url":"https://avatars.githubusercontent.com/u/8228710?v=3","gravatar_id":"","url":"https://api.github.com/users/srkimir","html_url":"https://github.com/srkimir","followers_url":"https://api.github.com/users/srkimir/followers","following_url":"https://api.github.com/users/srkimir/following{/other_user}","gists_url":"https://api.github.com/users/srkimir/gists{/gist_id}","starred_url":"https://api.github.com/users/srkimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srkimir/subscriptions","organizations_url":"https://api.github.com/users/srkimir/orgs","repos_url":"https://api.github.com/users/srkimir/repos","events_url":"https://api.github.com/users/srkimir/events{/privacy}","received_events_url":"https://api.github.com/users/srkimir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-25T23:33:42Z","updated_at":"2016-05-25T23:58:57Z","closed_at":null,"body":"What i'm trying to do with the plugin is to nack/reject message to dead letter exchange (which has a type equal to `'x-delayed-message'`) if there was any `recoverableError` during message processing.\r\n\r\nOnly first nacked/rejected message that gets to dead letter exchange will be published to given queue after `x-delay` time, all other succeeding messages that will be nacked/rejected will be published **immediately** when they arrive at dead letter exchange.\r\n\r\nFrom my debugging what i can see is that plugin will set **negative 'x-delay'** to all other messages except first one. Not quite sure is this a bug nor plugin doesn't play good with nack/reject messages or this is intended behaviour?\r\n\r\nIf it is intended behaviour how one can implement described scenario with plugin?\r\nWhat can be solution, as it seems to me, is to explicitly (instead nack/reject) publish to dead letter exchange with (re) setting `x-delay` on every publish, but why to throw away comfort that comes with `.nack()` or `.reject()`.\r\n\r\nGist: https://gist.github.com/srkimir/7d20576fa5b47dcd7b21f1950ace8cf9\r\nTopology: https://docs.google.com/drawings/d/1hlBHwFT4Xm4Nb6B0tEv4nEldTqgzDqUoNl_M3QTwuB4"},"comment":{"url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/comments/221742313","html_url":"https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/issues/52#issuecomment-221742313","issue_url":"https://api.github.com/repos/rabbitmq/rabbitmq-delayed-message-exchange/issues/52","id":221742313,"user":{"login":"srkimir","id":8228710,"avatar_url":"https://avatars.githubusercontent.com/u/8228710?v=3","gravatar_id":"","url":"https://api.github.com/users/srkimir","html_url":"https://github.com/srkimir","followers_url":"https://api.github.com/users/srkimir/followers","following_url":"https://api.github.com/users/srkimir/following{/other_user}","gists_url":"https://api.github.com/users/srkimir/gists{/gist_id}","starred_url":"https://api.github.com/users/srkimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srkimir/subscriptions","organizations_url":"https://api.github.com/users/srkimir/orgs","repos_url":"https://api.github.com/users/srkimir/repos","events_url":"https://api.github.com/users/srkimir/events{/privacy}","received_events_url":"https://api.github.com/users/srkimir/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T23:58:56Z","updated_at":"2016-05-25T23:58:56Z","body":"@michaelklishin Thanks on fast response. Can you use gist from question?\r\nhttps://gist.github.com/srkimir/7d20576fa5b47dcd7b21f1950ace8cf9\r\n\r\nI updated gist to contain few console.logs:\r\n```\r\nMessage initialy published at 2016-05-25T23:53:15.027Z\r\nMessage consumed at 2016-05-25T23:53:15.030Z, with x-delay = 1000\r\nREJECTED\r\nMessage consumed at 2016-05-25T23:53:16.037Z, with x-delay = -1000 // only this message is delayed for one second\r\nREJECTED\r\nMessage consumed at 2016-05-25T23:53:16.039Z, with x-delay = -1000\r\n...\r\n```"}}
{"actor":{"display_login":"srkimir"}}