Is there any way to (programmatically) find out, using TopicClient
class, if an Azure Service Bus Topic is full before sending message to it?
Asked
Active
Viewed 360 times
1

Marko
- 141
- 1
- 8
1 Answers
1
When you fetch a Topic
using TopicClient
, you get the information about it in an object of type TopicDescription
. TopicDescription
has two properties: MaxSizeInMegabytes
(which gives you the maximum quota for the topic) and SizeInBytes
(which gives you current size of the topic). Using these two, you can determine if or not the Topic is full.

mjwills
- 23,389
- 6
- 40
- 63

Gaurav Mantri
- 128,066
- 12
- 206
- 241
-
1Caution note: I would be reluctant to do that before each Send operation, since it will probably hit the performance – Mikhail Shilkov Nov 30 '17 at 11:20
-
1Anything to do with entities management or state is a performance hit :) To add to that, I would ask why do you need to test this? Perhaps you have a topic of a wrong size? Or you have subscribers that are offline for two long and their messages are piling up? What I'm after is that a publisher should not be concerned about size of the topic for every publish. – Sean Feldman Nov 30 '17 at 16:40