I have a Service Bus topic that has 400,000 messages pushed to it from an Azure Function. I have a second Azure Function that receives the messages as a trigger. When the 2nd Function ran, it successfully processed 98% of the messages. It left me with roughly 8,000 messages that failed. Either from an exception, or from my code, the message was abandoned. I've now got 8,000 messages sitting in a subscriber of the topic, that I can't get the Function to re-try processing.
The subscriber was originally set up to only allow 1 delivery of the message. I had done it that way because I was seeing the same message get processed multiple times while debugging. I wasn't sure if that was a side-effect of debugging in Visual Studio locally, or if messages would get sent to a Function multiple times. I assume this is what caused those messages to not have the Function re-run after they were abandoned (if that even is supported?).
I've changed the subscriber delivery count to 5, hoping that it would re-deliver the message to the Function. It didn't. What do I need to do now to get the remaining 8,000 messages to trigger the 2nd Function again?
Worst case is that I can delete the subscription, re-create the subscription and run the first Function over again, which should just publish the data associated with the original missing 8,000 messages (I have logic to handle missing data in the 1st Function). That would cause the 2nd Function to re-fire. I'd like to figure out how to handle it though when the subscription has the orphaned messages like this, as I'll experience this when I promote to production. I want this to be automated and not have to deal with manually cleaning up and re-running the process a 2nd time.
The following shows that there aren't any messages left in the Topic, but they exist still in the subscription.
I wrote the Functions in C# Functions 1.0 on Full Framework.