Search code examples
azureservicebusservicebus

How a message is send to receiver from queue/subscription?


My question is that how a receiver in service bus listens for new message? Does it send a query request to service bus for any new message after some interval or the service bus pushes any new message to the connected receivers?

I am using .NET client library and it uses SBMP protocol by default.


Solution

  • When you do manual receive (or batch receive), it doesn't really matter since the server will give you whatever your requested (or what it has at that moment if it's less than what was requested). In case you're using the OnMessage API with a callback, regardless of the transport, you'll get callback invocation upon each message irregardless was it pushed or pulled. With SBMP messages are polled from the broker by the client. With AMQP they are pushed on the client by the broker.