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?

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
답변함 일 년 전
  • 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
답변함 일 년 전
profile picture
전문가
검토됨 10일 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠