3

Referring to https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/GettingStarted/Microsoft.Azure.ServiceBus/BasicSendReceiveUsingTopicSubscriptionClient, I understand how Azure Service Bus Topics work in general, my question is more about how it actually works.

When a MesageHandler is registered (subscriptionClient.RegisterMessageHandler), it starts receiving messages as I see in

Console.WriteLine($"Received message: SequenceNumber:{message.SystemProperties.SequenceNumber} Body:{Encoding.UTF8.GetString(message.Body)}");

However, my question is whether the client actually receives the messages using a pull mode or it is a push from the Service Bus? Is there a continuous polling done by the Client to receive the messages - how does this work internally?

Filburt
  • 17,626
  • 12
  • 64
  • 115
Thomas
  • 1,970
  • 4
  • 28
  • 59

1 Answers1

4

The client is performing a long-poll. I.e. it will ask for a message and wait for it. If after a timeout period of one minute nothing is returned, it will poll again. In case a message is available before timeout expires, the message will be given to the message handler and polling will start again. Azure Service Bus does not push messages to the clients.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • thanks. Do you have any Microsoft reference articles to share, please? – Thomas Jun 21 '19 at 22:54
  • Documented [here](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted#foundational-capabilities), under receiving. – Sean Feldman Jun 21 '19 at 23:03