Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Bind an Event Listener In Azure Queue Storage

I have a Queue in Microsoft Azure Storage Explorer in which i'm passing a URI , Now the question is i don't want my server to ping every time to check whether something has came to queue or not despite, i want the client itself notify me that some message has arrived in queue, take appropriate action based on that.

i couldn't find any source in java where Event based example has been provided by Microsoft Azure.

Any Sample Working code or Reference in java will do, Thanks well in Advance.

like image 471
Mavericks Avatar asked Mar 10 '23 03:03

Mavericks


1 Answers

Azure Queues by themselves don't support this mechanism. Your server would need to poll the queue periodically to see if there are any messages in a queue.

If you don't want to write code for polling, an option would be to use service like Azure WebJobs or Azure Functions. Both of them have Storage Queue based triggers and can perform some functionality when a message arrives in a queue. So what you could do is have either WebJob or Function ping your server (assuming it is a web server) when a message arrives in a queue. Please note that these will also constantly poll the queue.

like image 124
Gaurav Mantri Avatar answered Mar 20 '23 12:03

Gaurav Mantri