My event bridge rule creates two duplicate messages

0

We have a lambda function that is triggered by EventBridge.

This EventBridge is used for the salesforce event - the event bus

So when a user creates an order, SF will generate an event for the order and send it through the event bus. Then AWS event bridge - will get it and invoke a lambda function.

All of a sudden, Event Bridge has been sending the same orders twice consecutively to Lamdda. Therefore, our orders have always been duplicated.
We can check this happen in our cloud watch logs and order logs as well. they have a different requestID but inside, they are the same order.

logs that show it has two same messages to invoke lamdba (two orders but 4 messages)

Dan
已提問 5 個月前檢視次數 701 次
3 個答案
1
已接受的答案

It's strange, but all of a sudden, all processes back to normal after 2 days of duplication. now, I am starting idempotency on Eventbridge.

Dan
已回答 5 個月前
profile picture
專家
已審閱 16 天前
0

EventBridge is a distributed service intended to ensure delivery. It makes the choice of potentially delivering more than once versus losing an event: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-troubleshooting.html#eb-rule-triggered-more-than-once

A best practice is to ensure the events are idempotent.

If it is happening repeatedly, then the likely source is the invocation of the event. You can look in CloudTrail and confirm that it is being invoked more than once.

profile pictureAWS
已回答 5 個月前
  • Thanks for the answer, my case is more complex - I could not define where this came from, but I will explain a bit more:

    1. The Salesforce website creates an order -> order event sent to AWS EventBridge via SF event relay.
    2. In the event bridge rule -> if it's from a partner site from SF and it's an order -> send an event to the cloudwatch log, then invoke the lambda function.
    3. The Lambda function will be executed to close the event.

    While processing #2, even if we got one order event message, in the lambda log, we could see it runs twice, creating two same orders in ERP. Also, sometimes, when we check the log from the event bridge, it appears to have two messages at the same time as the attached pics, but it doesn't matter how many messages we find in the log; invoking the same event is always more than twice.

    In case we create a new rule and disable the current rule, it will always create a duplicate message per rule, no matter if it's been disabled or enabled. For instance, three rules (two disabled) create 3 same messages.

0

Hello,

I understand that the service is working normally now.

If the problem arises again or to identify the root cause of the issue , I would recommend you to reach out to AWS Premium Support by raising a Support Case using the same account with all the information [+]. Kindly note that to identify root cause of the issue we require more information from your end which cannot be shared over public platform.

[+] https://console.aws.amazon.com/support/home#/case/create

Thank you.

likhita
已回答 5 個月前

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

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

回答問題指南