1

I have a queue trigger function that looks like this:

[FunctionName(nameof("MyQueueFunction"))]
public async Task Run([QueueTrigger("queue")] Model model, ILogger logger)
{
   if (model.ID == 0)
   {
      // Ignore message in the queue for now
   }
}

What I want to be able to do is re-queue the item if the condition stated is not met. I know I could just re-serialize the item and put it back on the queue myself, but is there a better way?

Thanks

William Troup
  • 12,739
  • 21
  • 70
  • 98
  • 1
    The Azure Storage Queues are somewhat limited in terms of filtering functionality. I suspect you will need to move to a Service Bus Queue/Topic and use the Queue/Topic filtering. Hoping someone will provide a different suggestion though :) – Kane Sep 07 '21 at 16:25
  • This is what I figured. I thought someone might know a way, but I guess re-queuing is the way forward. Thanks – William Troup Sep 08 '21 at 07:39
  • @Kane if you make that an answer, I will give you that. – William Troup Sep 12 '21 at 16:53

1 Answers1

2

Sadly, the Azure Storage Queues are somewhat limited in terms of filtering functionality.

I suspect you will need to move to a Service Bus Queue/Topic and use the Queue/Topic filtering.

Kane
  • 16,471
  • 11
  • 61
  • 86