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
asked 5 months ago616 views
3 Answers
1
Accepted Answer

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
answered 5 months ago
profile picture
EXPERT
reviewed 4 days ago
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
answered 5 months ago
  • 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
answered 5 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