sqs-consumer icon indicating copy to clipboard operation
sqs-consumer copied to clipboard

Message Attributes not working

Open bhavesh-pandey opened this issue 4 years ago • 2 comments

Question Hi I am using sqs-consumer to listen to my SQS queue subscribed to a SNS topic. Its listening to all the messages. No issues there. I have put some filters in SNS subscription (screenshot 1). Also configured it in my code (screenshot 2). I tried all permutation combinations of setting it only to attributeNames field, setting it only to messageAttributeNames filed, setting it to both, but nothing is working, I am receiving all messages, no matter which filter it has (screenshot 3)


Screenshots Screenshot 2020-11-09 at 1 42 25 AM SNS filters (1)


Screenshot 2020-11-09 at 1 43 44 AM Message attributes in code (2)
Screenshot 2020-11-09 at 1 46 13 AM Received message which has other filters too (3)

Am I doing anything wrong here?

bhavesh-pandey avatar Nov 08 '20 20:11 bhavesh-pandey

I have the same question, is it possible to have a consumer for each specific attribute?

joaovrgumiero avatar Dec 31 '20 03:12 joaovrgumiero

From what I can tell, this is not possible. I think what you might need to do is some how determine if it's a message that you want to process and if not, "fail" the message so that it gets returned to the queue. It would be nice if we had some kind of pre-processing event that you could simply return true (process message) or false (do not process message and put message back into queue).

adamleemiller avatar Apr 10 '21 08:04 adamleemiller

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 10 '22 01:12 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Dec 15 '22 02:12 github-actions[bot]