Azure queue: find whether item is in queue
Asked Answered
H

3

14

Is it possible to query an azure queue to find whether an item is somewhere in a specified queue (based on some key property)?

Haas answered 2/10, 2012 at 12:32 Comment(1)
The Service Bus Queues have a duplicate detection option, which may solve the problem?Subdeacon
M
9

Azure Queues are meant for async message passing, not searching. You should use an Azure Table or SQL Azure DB if you want indexing support.

Azure Queues will only let you peek the next message without dequeuing.

Mudpack answered 2/10, 2012 at 13:44 Comment(2)
Looking at the REST API, all message operations work off the front of the queue (or require a popreceipt, which means you retrieved a message from the front of the queue): msdn.microsoft.com/en-us/library/windowsazure/dd135717.aspx.Jeweljeweler
From the MSDN link you shared - it looks like you can PEEK a maximum of 32 queue messages without dequeuing them.Mudpack
L
-1

Please check Microsoft Azure Storage. This is a great tool for managing the contents. Upload, download and manage blobs, files, queues, tables and Cosmos DB entities.

Queue messages can be managed like depicted in pic below: enter image description here

Lithe answered 31/7, 2018 at 12:12 Comment(0)
G
-2

Of course it is very bad approach to perform search operations in message queue but you can try something like this:

        var qm = queue.GetMessages(20);
        if (!qm.Any(x => x.AsString.Contains(key_property)))
        {
            queue.AddMessage(message);
        }
Grady answered 5/6, 2019 at 20:53 Comment(1)
you can read only 32 messages maximum and this is a search on code levelCatwalk

© 2022 - 2024 — McMap. All rights reserved.