Cook the spaghetti al dente in plenty of salted water.
Chop the onion and garlic and fry together with the ham in a large pan in a little oil. Add the processed cheese with a little milk, stirring well so that it doesn`t burn. Now add the grated cheese. If the sauce gets too thick, just add a little milk every now and then.
When the cheese has melted, add the drained pasta. Mix everything well and finally fold in the finely chopped rocket. Season with salt and pepper and serve immediately.