Why am I not able to receive message from Event bridge schedules to SQS?

0

I've configured one schedulers from eventbridge which run every one minute and sending message in SQS. But I never received any message in it. Can you please help why is it like that? Enter image description here

Enter image description here Enter image description hereEnter image description here
Enter image description here

3 Answers
0

What is your SQS access policy setting?
Also, I believe there are API events left in CloudTrail, are there any errors?
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-basic-examples-of-sqs-policies.html

profile picture
EXPERT
answered 10 months ago
  • Here is the SQS access policy. also there are no error or log related to this in cloudtrail { "Version": "2008-10-17", "Id": "eventbridgesqspolicy", "Statement": [ { "Sid": "First", "Effect": "Allow", "Principal": "", "Action": "SQS:", "Resource": "arn:aws:sqs:us-east-1:<accountid>:staging-billing-scheduler.fifo" }, { "Sid": "Second", "Effect": "Allow", "Principal": { "Service": "scheduler.amazonaws.com" }, "Action": "SQS:*", "Resource": "arn:aws:sqs:us-east-1:<accountid>:staging-billing-scheduler.fifo", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:scheduler:us-east-1:<accountid>:schedule/default/staging-billing-scheduler" } } } ] }

  • From what I saw of the SQS access policy, the settings around the policy seemed fine. By the way, what kind of message is this EventBridge supposed to send to SQS every minute?

    {
        "Version": "2008-10-17",
        "Id": "eventbridgesqspolicy",
        "Statement": [
            {
                "Sid": "First",
                "Effect": "Allow",
                "Principal": "*",
                "Action": "SQS:*",
                "Resource": "arn:aws:sqs:us-east-1:<accountid>:staging-billing-scheduler.fifo"
            },
            {
                "Sid": "Second",
                "Effect": "Allow",
                "Principal": {
                    "Service": "scheduler.amazonaws.com"
                },
                "Action": "SQS:*",
                "Resource": "arn:aws:sqs:us-east-1:<accountid>:staging-billing-scheduler.fifo",
                "Condition": {
                    "ArnLike": {
                        "aws:SourceArn": "arn:aws:scheduler:us-east-1:<accountid>:schedule/default/staging-billing-scheduler"
                    }
                }
            }
        ]
    }
    
  • I have set the cron job for testing and debugging. actually, event bridge scheduler will generate one event in 24hrs. I am also confused that access policy is correct even IAM role for scheduler is also correct then why I am not receiving message in queue

0

I found that somehow Eventbridge scheduler is not working with FIFO SQS. If we change it to a standard queue then it is working perfectly fine.

answered 10 months ago
0

@Vimox Shah - I had the same issue as you did. I was able to fix it by understanding the logic of the deduplication in SQS FIFO. The message can contain either a "MessageDeduplicationId" OR you can let SQS calculate the MD5 to auto-generate a "MessageDeduplicationId ".
The issue is that the scheduler cannot send a "MessageDeduplicationId " , therefore, you MUST enable on the queue "ContentBasedDeduplication " = true

You can read here in "SqsParameters": https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/scheduler/client/create_schedule.html If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled.

Unfortunately, it seems the deduplication is done every 5 minutes, so you won't be able to get a 1 minutes scheduler.

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions