What about topics?
Topics are tricky because it's a pub/sub model. If you publish one message to the topic, all subscribers receive a copy of that message. Let's say I have a topic with 10 subscribers. Subscriber 1-9 process the message just fine. Subscriber 10 gets its message, but hits an exception. If you followed this code above for the topic, the message would be scheduled back onto the topic. However, that means not only would subscriber 10 get the retry, but subscribers 1-9 would get a copy of the retry too.
My recommendation is that for topics where you want to enable exponential retries, use the forwarding feature of Azure Service Bus. The forwarding feature allows you to forward all messages to a queue or topic subscription to another queue or topic. In the case above I created a queue in my namespace for subscriber 10. I then ran the following CLI command to forward all messages to subscriber 10s subscription to that new queue. Now I have my function fire and exponentially retry on t