Even when a sender application sends a message only once, the receiver application may receive the message more than once.
The term idempotent is used in mathematics to describe a function that produces the same result if it is applied to itself: f(x) = f(f(x)). In Messaging this concepts translates into a message that has the same effect whether it is received once or multiple times. This means that a message can safely be resent without causing any problems even if the receiver receives duplicates of the same message.
The recipient can explicitly de-dupe messages by keeping track of messages that it already received. A unique message identifier simplifies this task and helps detect those cases where two legitimate messages with the same message content arrive.
In order to detect and eliminate duplicate messages based on the message identifier, the message recipient has to keep a list of already received message identifiers.