0

I am following this https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-how-to-use-topics-subscriptions to learn how to use Service Bus Topic and Subscriptions to receive messages.

It 1st sends 10 messages and then receives the 10 messages.

However, once I finished coding and ran the code, the 10 messages were sent, but I only received 8 of them, there were 2 of messages still in the subscription.

Could anyone enlighten me on

  1. why this happened?
  2. Is it okay to happen?
  3. how to prevent it from happening again?
  4. once happened, what is the best practice to handle this situation?
Franva
  • 6,565
  • 23
  • 79
  • 144
  • Have you looked at [ServiceBusExplorer](https://github.com/paolosalvatori/ServiceBusExplorer) you can see there what is in a MessageQueue/Topic (without editing it), it makes debugging these issues much easier? – Minijack Jun 13 '19 at 05:14
  • hi @Minijack yes, I did. It's basically a desktop GUI for Azure portal, which only shows me 2 messages still in the subscription, but it doesn't answer my question. – Franva Jun 13 '19 at 05:20
  • If you run the subscriber (without running the publisher) are you able to receive the messages? (does ProcessMessagesAsync ever get called?) – Minijack Jun 13 '19 at 05:28
  • @Minijack yes, after the 1st of running subscriber(which only received 8 messages), I ran the subscriber again, but nothing received. After that I added another 2 messages and ran the subscriber again, now I received all the 4 rest messages. It gives me an impression that the service bus isn't really reliable. Although I think it shouldn't be like this. – Franva Jun 13 '19 at 06:36
  • How do you receive? Show the code or share it on GitHub please. – Sean Feldman Jun 13 '19 at 18:37
  • 1
    @Franva I can definitely vouch for ServiceBus' reliability as we use it in production – Minijack Jun 13 '19 at 23:38
  • What does your queue do with duplicates? – smurtagh Aug 11 '23 at 14:15

0 Answers0