Should there really be a check for emptiness here? Can the messageid be empty?

Because if it is, then you don't have idempotency anymore, right?