At times it is challenging when we are faced with negative emotions aimed at us. We can only rely on ourselves to choose how we let them effect us. If you want to grow from these experiences, work towards understanding the dynamics at play by looking within to find the 'button' being pushed. Then you can learn to process it for yourself.
Sometimes people will lash out at others because of their own insecurities or issues. It is important to realize this so you can become the observer in the situation; be aware of your own actions as well and be clear what part you play in the confrontation. The more you recognize your own feelings the better you will be able to assess the way you can best handle yourself for the most productive outcome.
Learn from these experiences and remember, we cannot control others. We can only control our own actions. We can choose how to deal with life and help ourselves grow and take responsibility for our actions.
If you want to get someone's attention, don't react to their antics. They will eventually lose interest in fighting with you if they can't "get your goat." Set an example.