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

已提問 1 年前檢視次數 2745 次
3 個答案
1

@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.

已回答 1 年前
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
專家
已回答 1 年前
  • 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.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南