No, it is not compulsory. Unless both the party sign in front of the judge that they agree to mediation one cannot be forced.
Mediation is a negotiation process in which a neutral third party assists the disputing parties in resolving their disputes. A Mediator uses special negotiation and communication techniques to help the parties to come to a settlement.
The parties can appoint a Mediator with their mutual consent or a mediator can be appointed by the Court in a pending litigation. Mediation always leaves the decision making power with the parties.
A Mediator does not decide what is fair or right, does not apportion blame, nor renders any opinion on the merits or chances of success if the case is litigated. Rather, a mediator acts as a catalyst to bring the two disputing parties together by defining issues and limiting obstacles to communication and settlement.