1
votes

I have an API exposed in WSO2 ESB. In these API there are many resources, and each one of them have oauthservice mediator, dbreport mediator and diferent endpoints for a same API context.

What is the best way to define these resources without repeating the mediators in each resource in WSO2 ESB API?

Thanks in advance.

1

1 Answers

1
votes

Include the OAuthMediator and DBReport Mediator inside sequences (sequence for each mediator) and call it within the API definition. You can also create an endpoint key in the registry for the API endpoint and refer it in the API directly as shown below.

    <send>
        <endpoint key="gov:endpoints/StockQuoteEP.xml"/>
    </send>