From the way you have put in, it appears you are going through tough time. If i may ask you...is your boss truly trying to sideline you? do you fully believe in whatever your customer tell you? how has been your relation with your boss before and now? what would have made him change his opinion now, if there is any change? do you believe that the junior guy is performing better than you, in terms of efficiency? isn't your boss trying to build capacity in junior guys as a means to succession planning? isn't your job indispensable? have you ever failed in your duties and why?
Try asking above few questions. If you still feel you are being sidelined, perhaps it is good to speak to your boss. Be soft and put up your point straight. Tell him your feelings. Don't confront or pick up the argument with your boss. As far as i am concerned, confrontation will be my last resort. After having exhausted with all means to come to expected normal situation, you may escalate the matter to the higher management.
Even after having done all you could do, and if there is no change in the way he handles you, perhaps, exit may be a right approach. No matter how high is your pay, no matter how hard you work, but if you have strained your relations with boss, colleagues, then you would not enjoy working.
Meanwhile, please keep up and cheers!
Dorji