I agree with what others have said about boundaries around rude behaviour.
For the question around how to stop ruminating on a past event i guess there are lots of approaches that might work, apologies if you have tried these already. Is there anything in common in the interactions on the past that have caused you to respond this way?
For ruminating about a relationship/interaction i wonder if writing a letter (but not sending it) to that person would help. The letter gives you a chance to say your piece, to state what they did and why it was hurtful, and then to let it rest in the letter rather than your brain. You can choose what to do with the letter afterwards (tear it up, bury it, burn it, or re-write a softer version when your emotions around the situation are calmer).
Getting 'unstuck' from the thought of emotion itself can be done through a process called cognitive defusion - there are lots of exercises to try this, try looking for things like 'leaves on the stream'. Alternatively give yourself space from thoughts by a bit of verbal trickery .e.g. if you have the thought "he's rude" and it causes an emotional response, try elongating the phrase to "i'm having the thought that he's rude" and then to "i'm noticing that i'm having the thought that he's rude" - it removes some of the punch and gives you space to choose whether it is helpful for you to get stuck with that thought.
You can also try to say 'thanks, brain' for these thoughts (sounds counter intuitive, but bear with me). This gives you a chance to acknowledge your brain is replaying this situation for a reason (such as keeping you safe if there is a next time, giving you time to think of an alternative response, etc), and you can say thanks for it doing this job, and then move past this. It is explained better by Russ Harris here: