I got a vaccination in the youth/child against measles. I don't know if that lasts for ever. So I guess you did not have a vaccination against it
I DID have the vaccination, and it does not last for ever - you can still catch measles. In my case my children all came down with measles as they were not vaccinated and I nursed them one by one for a period of 6 weeks - then I came down with it, and then had pneumonia.
Having the wild type of measles itself is the only way to get lifelong immunity.