I'm working a single subscription, a single listener. No sessions. I'm trying to implement a retry solution for transient business errors. When a db server goes down (for example), I want to clone and re-submit the message to the topic with a ScheduledEnqueueTimeUtc 5 seconds in the future. To prevent dupes with other subscriptions, i'm setting a filter on all my Subscriptions that will look for a user property with the subscription name (or blank).
First I call CompleteAsync() on the original message.
Then I call SendAsync() on the new (cloned) message, to the same topic.
Problem:
If I wrap these 2 calls in a transaction, I get the following exception:
"ServiceBusException: Transaction hasn't been declared yet, or has already been discharged"
Can't figure out why I'd be getting this error. One thing is, I cannot find an example transaction that uses subscriptions - they're all using queues. Are subscriptions possible for transactions?
I can do 2 SendAsync() calls within a transaction, but not a CompleteAsync() and a SendAsync()
Thanks, any suggestions are appreciated.