After reading MS documentation I´m trying to understand what is the difference betweeen a Queue listner and simply make a retrieve request every minute on the queue?
Asked
Active
Viewed 628 times
1 Answers
0
They are quite not the same, it would be more of two different techniques or design patterns if you want.
When you listen to a queue, you are waiting for a "signal" that states that a new messages have arrived in the queue. This is called a event-based pattern. While polling, you are constantly checking if there's a new messages, even if there is no new messages, and that is another design pattern.
See this answer for difference between event driver and polling based design. See this answer for a discussion on when to poll, and when to observe.

Jostein Sortland
- 311
- 2
- 10
-
OK.In the latter link you sent, it states that "If process A crashes, it will never unsubscribe, and process B will try to send notifications to it for all eternity, unless it can reliably detect remote process failures (not an easy thing to do)". Will this also be the case with Azure Service Bus? (Will Azure Service Bus continue to try to send messages when the listener is down?) – Chris111 Mar 31 '20 at 07:40
-
Azure Service bus does not send messages. A service bus is place that store and distribute messages. I.e. you send a message to either a topic or a queue on the service bus. Then the messages resides there until you do any action upon it. It is completely independent of any listener. So say you have a listener that consumes the messages on a queue. If this listeners goes down, you can still send messages to the queue. This is the main part of a async pattern. In short, listener down, messages will still come to the bus, and pile up there, until listener is up and starts to consume them. – Jostein Sortland Mar 31 '20 at 08:48
-
OK. When the listener consumes messages from the Service Bus, how does it work if it does not poll for e.g. every minute? – Chris111 Mar 31 '20 at 12:44
-
That is a whole other topic. And can be implemented in several different ways. In Azure you could use something like the EventGrid. See this answer for an explanation of how it works on both a low and high level: https://stackoverflow.com/a/3182336/5495211 Please accept my answer above as it answers your initial question. – Jostein Sortland Apr 01 '20 at 06:38