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 réponses
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
répondu il y a un an
  • 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
répondu il y a un an
profile picture
EXPERT
vérifié il y a 10 jours

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions