Creating Custom Mediators
WSO2 ESB comes with an assortment of mediators to filter, transform, route and manipulate messages. When the existing mediators come short, you can write your own mediators to implement your specific business requirements. Your custom mediators then must be plugged into the WSO2 ESB. After adding them to the ESB, they function together with core mediators which come with the product. The custom mediators can be distributed in a packaged form that can be installed in another WSO2 ESB instance.
Refer to Writing a WSO2 ESB Mediator.