Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Azure Service Bus Queues to push messages to clients without polling?

I am new to Azure Service Bus and I found that I need to continuously poll for Queue messages in order to receive them. However, I want the Queue to push the message to some sort of listener on the client-side of things without it having to poll for messages.

I have read that polling is optional in Azure Service Bus but I couldn't find how to receive messages without it.

Please help if you can. Thank you

like image 352
Kenchi Avatar asked Nov 14 '18 11:11

Kenchi


People also ask

Is Azure Service Bus push or pull?

Event Grid works on a Push mechanism, which means that the Event Grid pushes the event to its Subscribers, whereas in Service Bus, the subscribers pull the messages from the Bus.

How do I send multiple messages to Service Bus queue?

To send bulk messages in a Service Bus Queue or Topic you should navigate to the required Service Bus Namespace > Navigate into the required Queue or Topic > Click the add message icon to send messages. You can configure the message count to send bulk messages.

Which protocol is used by Azure Service Bus for message delivery?

Azure Service Bus' primary protocol is AMQP 1.0 and it can be used from any AMQP 1.0 compliant protocol client. Several open-source AMQP clients have samples that explicitly demonstrate Service Bus interoperability.


2 Answers

I have read that polling is optional in Azure Service Bus but I couldn't find how to receive messages without it.

Polling is optional if you start receiving on demand. Otherwise, it's not optional and long-polling will take place.

I want the Queue to push the message to some sort of listener on the client-side of things without it having to poll for messages.

There's a way to achieve exactly that using Event Grid integration with Azure Service Bus. Service Bus will emit an event to notify about messages awaiting processing and no active listeners. That way your application/system reacts and doesn't have to poll.

Note that the key scenario for this feature is low volume of messages that do not need to have a receiver that polls for messages continuously.

like image 72
Sean Feldman Avatar answered Oct 05 '22 18:10

Sean Feldman


It should be possible. Take a look on the following to get an idea on how it could be done:

  • Get started with Service Bus topics
  • Get started with Service Bus queues

Hope it helps!

like image 20
Itay Podhajcer Avatar answered Oct 05 '22 19:10

Itay Podhajcer