azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Can see messages in subscription of bus service but can't retrieve

Open hieuhc opened this issue 9 years ago • 4 comments

I can see there are a number of messages in a subscription both in Azure portal and when using message_count method of that subscription. But I can't retrieve any of them with receive_subscription_message. Those messages are supposed to be unlock already. Does anyone know what could be the reason for this behavior?

Also, I need to delete those messages. Is the only way with Python API to use receive_subscription_message? Does Message time to live parameter in Azure portal help with this?

hieuhc avatar Sep 06 '17 09:09 hieuhc

I'm unfortunately not a specialist in SB, but it seems to me the last time I saw that, was a DLQ: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dead-letter-queues

You can try SBE to figure that out: https://github.com/paolosalvatori/ServiceBusExplorer

lmazuel avatar Sep 07 '17 17:09 lmazuel

Thanks for suggesting SBE. I checked and they are actually Dead Letter Queue messages. I wonder if you have plan to implement methods to count active and DLQ messages separately?

hieuhc avatar Sep 13 '17 13:09 hieuhc

DLQ is a regular queue, it's just that the name is a system one. There is a staticmethod format_dead_letter_queue_name to build that name for you. You can then use a DLQ with exactly the same methods a regular queue. https://github.com/Azure/azure-sdk-for-python/blob/master/azure-servicebus/azure/servicebus/servicebusservice.py#L157-L160

lmazuel avatar Sep 13 '17 19:09 lmazuel

Ah nice. Thank you for your support. I close this (not really) issue here.

hieuhc avatar Sep 14 '17 10:09 hieuhc