0
votes

I've been experimenting with the latest Azure Service Bus SDK. Using very low-volume topic messages (posted by manually-executed Azure Function HTTP triggers from my browser), I'm seeing a pretty high failure rate in the Azure dashboard -- something like one out of every four or five messages fails. However, I don't ever catch any exceptions in the Azure Function code. How is a sending application supposed to detect these failures? For that matter, how do I log the specific failures? I see the spikes in the graph but can't find details. (I'm using an MSDN VS Enterprise freebie subscription.) Sometimes the queued messages and/or failures don't show up in the Azure portal for several minutes. (So far I haven't written a subscriber but I'm guessing the portal is effectively a "subscribe to everything" client of some kind.)

The topic is non-partitioned with a long TTL (the 14-day default). No dupe detection. The code is simple enough (try/catch omitted), newevent is a simple C# class with just a couple of properties and ToString is an override using JsonConvert:

        TopicClient topic = new TopicClient(connection, topic);
        Message msg = new Message(Encoding.UTF8.GetBytes(newevent.ToString()));
        msg.MessageId = newevent.Timestamp;
        await topic.SendAsync(msg);
        await topic.CloseAsync();
1
Please add more details about failure - where you see them, any additional info like error text etc.Mikhail Shilkov
As stated earlier, I see error counts in the Portal, and no exceptions are triggered so I can't tell you what the errors are.McGuireV10
A few more slow-fire tests (one hit every few seconds) and I'm falling below a 50% success rate. Five messages received and delivered out of 12 actually sent -- and still no exceptions at the sender. (I only just now added a subscriber for test purposes, which is why all the deliveries happened at once.) !portalMcGuireV10

1 Answers

1
votes

I don't think it's a blocker for low-volume traffic, but you shouldn't new up and close your TopicClient for each message. You can create it once and reuse for subsequent requests.

In the context of Azure Functions, you are better off using output binding feature instead of creating TopicClient yourself, see example in docs. The runtime will manage topic client for you then.