I have seen most queue example as the polling mechanism . Is it possible to change it to listner of the queue. Because polling may affect the performance of the worker.
-
"Because polling may affect the performance of the worker" - Really? How often do you plan on polling? Can you share more about the performance problems you've run into? – user94559 Jul 31 '12 at 15:59
-
@smarx will it not affect the performance because we are using the resources unnecessary . but your question is valid i will do a performance run on that . But to be noted we are making a http call with the queue. – satish Aug 01 '12 at 04:51
2 Answers
Both Windows Azure Storage Queues and Windows Azure Service Bus Queues utilize polling and do not have a notification feature per se; however, Windows Azure Service Bus Queues do support long polling which is as close to a notification approach as you can get currently. When you use the Receive method from MessageReceiver it will use long polling (meaning it will request a message and if there isn't one in the queue the server won't immediately respond, but will wait a period of time until either a message comes into the queue when it will respond to the client, or until an idle time passes in which case it will return a response with no message. The Receive method by itself will give the impression of a synchronous call to get a message and will not return until a message appears, but it has overloads to allow for idle times so you don't get into an infinite wait).
In Service Bus Topics you can set up as a subscriber, but you will still be polling the topic to get your messages, so I don't think that is at the heart of what the OP is asking.

- 40,302
- 20
- 199
- 253

- 10,887
- 1
- 38
- 44
-
But it will be good if we have listner. Any idea if this availble in MS connect .else i can add a connect bug – satish Jul 31 '12 at 10:14
-
I'm not aware of a request for a full on notification feature currently. – MikeWo Jul 31 '12 at 10:18
Using Windows Azure Queue, your only option is polling. While with the Service Bus Topics/Subscription, you can have full pub/sub model, where your subscriber will be a "listener".

- 30,768
- 3
- 70
- 86
-
2But you will still be polling the topic on a Service Bus Topic to retrieve your messages. The subscription model simply lets you have multiple destinations for an inbound queue message, plus filtering; however, in the end, the listeners (or consumers) will still be polling their respective topics for their messages. – MikeWo Jul 31 '12 at 10:12