{"action":"created","issue":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/507","labels_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/507/labels{/name}","comments_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/507/comments","events_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/507/events","html_url":"https://github.com/EasyNetQ/EasyNetQ/issues/507","id":117563575,"number":507,"title":"Consider to implement a DeadLetterStrategy (new ConsumerErrorStrategy)","user":{"login":"micdenny","id":1633595,"avatar_url":"https://avatars.githubusercontent.com/u/1633595?v=3","gravatar_id":"","url":"https://api.github.com/users/micdenny","html_url":"https://github.com/micdenny","followers_url":"https://api.github.com/users/micdenny/followers","following_url":"https://api.github.com/users/micdenny/following{/other_user}","gists_url":"https://api.github.com/users/micdenny/gists{/gist_id}","starred_url":"https://api.github.com/users/micdenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micdenny/subscriptions","organizations_url":"https://api.github.com/users/micdenny/orgs","repos_url":"https://api.github.com/users/micdenny/repos","events_url":"https://api.github.com/users/micdenny/events{/privacy}","received_events_url":"https://api.github.com/users/micdenny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-18T11:01:54Z","updated_at":"2015-11-18T12:48:52Z","closed_at":null,"body":"The idea started from this issue https://github.com/EasyNetQ/EasyNetQ/issues/479 and @snebjorn has implemented a solution.\r\n\r\nOpen discussion, say yours."},"comment":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/comments/157701810","html_url":"https://github.com/EasyNetQ/EasyNetQ/issues/507#issuecomment-157701810","issue_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/507","id":157701810,"user":{"login":"zidad","id":303034,"avatar_url":"https://avatars.githubusercontent.com/u/303034?v=3","gravatar_id":"","url":"https://api.github.com/users/zidad","html_url":"https://github.com/zidad","followers_url":"https://api.github.com/users/zidad/followers","following_url":"https://api.github.com/users/zidad/following{/other_user}","gists_url":"https://api.github.com/users/zidad/gists{/gist_id}","starred_url":"https://api.github.com/users/zidad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zidad/subscriptions","organizations_url":"https://api.github.com/users/zidad/orgs","repos_url":"https://api.github.com/users/zidad/repos","events_url":"https://api.github.com/users/zidad/events{/privacy}","received_events_url":"https://api.github.com/users/zidad/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T12:48:52Z","updated_at":"2015-11-18T12:48:52Z","body":"In my experience, I only want to have retries in very specific scenario's (so for specific exceptions like time outs, deadlocks) or transition states (still uploading, processing file, etc), in which case they are part of your 'business' logic, so a generic retry would not be my first choice. \r\n\r\nIntegrating ENQ with something like Polly could be really interesting:\r\nhttps://github.com/michael-wolfenden/Polly\r\n\r\nMore in general, I'd like the core of ENQ to be as small and specific as possible, but with entry points where you can plug mechanisms like this in so you can package it in separate packages/assemblies. \r\n\r\nArguably, I think we could make the ENQ core even smaller, things like the AutoSubscriber could be extracted out.\r\n\r\nI've implemented a custom dispatcher that supports pre/post/error event handlers for messages, that you can attach to a subscriber using attributes, which will allow you to plug in custom retry mechanisms, saga-like operations, etc:\r\nhttps://github.com/zidad/net-tools/blob/master/src/Net.EasyNetQ/Autofac/AutofacMessageDispatcher.cs\r\n\r\nsample of a retry strategy:\r\nhttps://github.com/zidad/net-tools/blob/master/src/Net.EasyNetQ/ErrorHandling/RetryStrategy.cs\r\n\r\nDisadvantage now is that it's all dependent on autofac and autosubscriber."}}