I need to map my custom synapse handler to a specific API in WSO2 EI 6.1.1. I tried below two separate methods to configure the Custom synapse Handler to map with API
method 1: configure the handler in EI_HOME/conf/synapse-handlers.xml This way the handler applied to all APIs. ref:https://docs.wso2.com/display/EI600/Writing+a+Synapse+Handler
method 2: configure the handler in API xml
......</resource>
<handlers>
<handler class="org.test.TestHandler1"/>
</handlers>
</api>
this way it leads to an error when starting the EI server. looks like method 2 is possible on WSO2 ESB not WSO2 EI
looking for a way to do this. note: I am extending AbstractSynapseHandler to create custom synapse handler
thanks in advance
The link that you have provided contains a sample which extends org.apache.synapse.AbstractSynapseHandler. But if you want an API level handler, your handler should implement org.apache.synapse.rest.Handler instead of extending org.apache.synapse.AbstractSynapseHandler. Below is a sample Handler which should work in your case.
The way that you configured the Handler in your API xml is correct. (However, note that you cannot add a handler to API through web interface.)
For more details visit WSO2 documentation through below link. https://docs.wso2.com/display/EI600/Securing+APIs