maname's comments

maname | 1 year ago | on: Heard of Idempotency but unsure what it is?

thanks, that clicks.

"Simply put, we can perform an idempotent operation multiple times without changing the result.

Furthermore, the operation must not cause any side effects after the first successful execution."

Baeldung got it right.

maname | 1 year ago | on: Heard of Idempotency but unsure what it is?

IMO these statements contradict themselves:

> Idempotency refers to the ability of an operation to be performed multiple times whilst still yielding the same outcome

and

> The issue with the above code is that if the event is processed twice the EmailService will send a duplicate email.

In other words, the operation (three lines of code) yields the same result (sending an email) after repeated execution, and thus is idempotent isnt it? Or is the point that idempotency is harmful in this case?

page 1