In queue message count in service bus

424 views Asked by At

I want to know that is there any message inqueue limit define for service bus queue or topic.

Let say I have create a device on azure iot hub .Now I am sending c2d message to this device. If there is no receiver available for this device. Then it has capability to save 50 message in queue. After this limit . It will discard all the c2d message send to it.

I just want to confirm that same kind of scenario create in service bus queue or topic.

May be this scenario not exists with service bus queue or topic. But I have some confusion.

2

There are 2 answers

0
Rita Han On BEST ANSWER

I want to know that is there any message inqueue limit define for service bus queue or topic.

Yes, there is a limit at size of queue/topic(Defined upon creation of the queue/topic).

The size of queue/topic is can be 1, 2, 3, 4 or 5 GB. If partitioning is enabled, the maximum queue/topic size is 80 GB.

If you exceeded the limit,

incoming messages will be rejected and an exception will be received by the calling code.

More information you can reference Service Bus quotas.

0
Slava Asipenko On

I am not aware of ASB supporting exactly this kind of quota out of the box. I would recommend approaching it differently: use DefaultMessageTimeToLive property on your queue or topic (set when they are created). This will allow you to auto discard old, obsolete messages which were not processed in time. Or you can set TimeToLive on BrokeredMessage on individual messages.

Alternatively, you can also set MaxSizeInMegabytes on your queue / topic to limit their sizes, but I think TTL based approach would be better.