{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1986","repository_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1986/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1986/comments","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1986/events","html_url":"https://github.com/Azure/azure-webjobs-sdk/issues/1986","id":373951179,"node_id":"MDU6SXNzdWUzNzM5NTExNzk=","number":1986,"title":"How to intentionally deadletter a message is azure functions v2","user":{"login":"bledbet","id":15837692,"node_id":"MDQ6VXNlcjE1ODM3Njky","avatar_url":"https://avatars3.githubusercontent.com/u/15837692?v=4","gravatar_id":"","url":"https://api.github.com/users/bledbet","html_url":"https://github.com/bledbet","followers_url":"https://api.github.com/users/bledbet/followers","following_url":"https://api.github.com/users/bledbet/following{/other_user}","gists_url":"https://api.github.com/users/bledbet/gists{/gist_id}","starred_url":"https://api.github.com/users/bledbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bledbet/subscriptions","organizations_url":"https://api.github.com/users/bledbet/orgs","repos_url":"https://api.github.com/users/bledbet/repos","events_url":"https://api.github.com/users/bledbet/events{/privacy}","received_events_url":"https://api.github.com/users/bledbet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-25T13:36:30Z","updated_at":"2018-10-29T10:19:26Z","closed_at":null,"author_association":"NONE","body":"#### Repro steps\r\n\r\nProvide the steps required to reproduce the problem\r\n\r\n1. ServiceBusTrigger fires\r\n\r\n2. Function processing identifies a non-retryable error, and it is desirable to send the message straight to deadletter, rather than roll back and retry until the max receive count is exceeded.\r\n\r\n3. The ServiceBus client assembly that AFv2 is integrated with can bind the incoming message to the Message class, but unlike the old BrokeredMessage class from previous ServiceBus assemblies, Message does not have a Deadletter() method.\r\n\r\n4. Other than deadlettering when a non-retryable error is identified, I'm not looking to have to deal with all message lifecycle in the entire FunctionApp (the solution to turn this off for the entire function app, which could have many functions, when you only need to explicitly deadletter in a few cases, seems heav-handed).\r\n\r\n#### Expected behavior\r\n\r\nCouple of options I can think of:\r\n\r\nA way to do something like Message.Deadletter(), and return from the function, and the Function runtime realizes that there is nothing further to be done with the message.\r\n\r\nA way to throw a specific kind of exception (FunctionNotRetryableException?), and the Function runtime uses this as a signal to deadletter the message rather than just abandon it.\r\n\r\n#### Known workarounds\r\n\r\nI can find no other solution than to create my own \"deadletter queue\" for each subscription/queue that might need this.  This is not desirable in large integrations solutions when you already have dozens of subscriptions/queues.\r\n\r\n#### Related information \r\n\r\nVisualStudio 15.6.7\r\nAzure Functions and Web Jobs Tools 15.10.2046.0\r\nMicrosoft.Azure.WebJobs.Extensions.ServiceBus 3.0.1\r\nMicrosoft.Azure.ServiceBus 3.0.2\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/comments/433857627","html_url":"https://github.com/Azure/azure-webjobs-sdk/issues/1986#issuecomment-433857627","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk/issues/1986","id":433857627,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzg1NzYyNw==","user":{"login":"mpMelnikov","id":7716624,"node_id":"MDQ6VXNlcjc3MTY2MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7716624?v=4","gravatar_id":"","url":"https://api.github.com/users/mpMelnikov","html_url":"https://github.com/mpMelnikov","followers_url":"https://api.github.com/users/mpMelnikov/followers","following_url":"https://api.github.com/users/mpMelnikov/following{/other_user}","gists_url":"https://api.github.com/users/mpMelnikov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpMelnikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpMelnikov/subscriptions","organizations_url":"https://api.github.com/users/mpMelnikov/orgs","repos_url":"https://api.github.com/users/mpMelnikov/repos","events_url":"https://api.github.com/users/mpMelnikov/events{/privacy}","received_events_url":"https://api.github.com/users/mpMelnikov/received_events","type":"User","site_admin":false},"created_at":"2018-10-29T10:19:26Z","updated_at":"2018-10-29T10:19:26Z","author_association":"NONE","body":"Really need this feature too. \r\nIs it going to be implemented? Is there any known workarround except creation of my own \"deadletter queue\"?\r\nIf somebody from azure-webjobs-sdk team could provide me some guidance, maybe I can implement this feature?\r\n\r\ncc: @mathewc "}}
{"actor":{"display_login":"mpMelnikov"}}