0
votes

I have long poll setup (with the Amazon SQS client lib) to pull messages as they come in, but some messages don't need to be read and deleted by this host, so they are skipped. I was wondering if there is a way to tell my next long poll request to skip those excluded messages?

My end goal is to have a long poll setup to process messages from a queue without executing the completion block for certain excluded messages. Is there a better methodology I should be using?

1
Without any further details in your post, do you think these excluded messages are sufficiently different in purpose to justify creating a separate queue for them? - Anthony Neace
That's the first thing that crossed my mind, but it seems like it would increase complexity too much for just a few dropped messages here and there. Are there any details that would be more helpful? I was going to add a couple code snippets but didn't want to clutter the question with Objective-C code. - Zack
If your listener on "this host" isn't supposed to process them, then who is? All of the workers listening to a given queue should typically be identical. This seems like an unusual configuration for SQS. - Michael - sqlbot

1 Answers

1
votes

If you really are not going to use some of the messages, you should either not put them in the queue in the first place (if thats possible), and if not, the process that detects the 'bad' messages should remove them from the queue.

Third option, which would only be worth doing if the messages are going to be used eventually, is to put them in their own queue. There is no extra cost to have multiple queues, so use more queues if it make sense.