Duplicate event fired

0

Hello everyone,

I am facing an odd situation here. I have some events since a few days that are fired 2 times in the same bus (default). They are exactly the same : content and id. And so they triggered some lambdas two times messing with our event process. I thought it should be impossible. I assume that if there are two logs in events/debug, there are two event fired.

Look at the photo. You can see the same id in the JSON at the same hour.

Duplicate log

If you have any idea about what can cause that.

Thanks for your help.

EDIT 1 : The events are generated by a lambda using aws sdk for nodeJs and method putEvents.

  • What was the event source?

newza
已提問 1 年前檢視次數 228 次
2 個答案
0

Thanks for your response.

I was aware that a rule could be triggered multiple times. But here it is more that the event is fired two times. (maybe it means the same for AWS, but I think there is slight difference)

In any case make the lambdas idempotent should be the solution. As a best practice, for the unique id, is it better to use the id generated by event bridge or an id in the payload coming from our internal process ?

Thanks

newza
已回答 1 年前
  • I would recommend you make the idempotency in the payload of the message that can be identified by your internal systems.

0

This can happen in a large distributed system (which Amazon EventBridge is). See the documentation here: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-troubleshooting.html#eb-rule-triggered-more-than-once

A best practice is to make events idempotent, for more than this rare occurrence. You may need to replay events under some recovery scenarios. See the AWS Well-Architected Framework Best Practice, Make all responses idempotent.

profile pictureAWS
已回答 1 年前
profile picture
專家
已審閱 10 天前

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

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

回答問題指南