Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

If exception occurs is there any way to send message into dead letter topic using c#?

$
0
0

I have azure function app which trigger based on new message into service bus topic.

But if any exception occurs i want to send message into dead letter topic how to do that?

[FunctionName("ProcessData")] public static void Run([ServiceBusTrigger("topic", "sub1", Connection = "ConnectionStringSettingName")]string mySbMsg, TraceWriter log) { try { //process message mySbMsg DataSchema data = JsonConvert.DeserializeObject<DataSchema>(mySbMsg); ... } catch(Exception ex) {

sendErrorEmail();

// How to send message into Dead letter explicitly ? } }


SE



Viewing all articles
Browse latest Browse all 1916

Trending Articles