0

I am following given documentation to create a global synapse mediator, but it seems that my mediator is not used. When I upload the same mediator XML to the API on publisher, works properly.

My XML meditor:

<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--In">
    <property name="X-Client-Remote-Addr" expression="get-property('axis2', 'REMOTE_ADDR')" scope="transport"/>
    <property name="X-Client-Forwarded-For" expression="$trp:X-Forwarded-For" scope="transport"/>
</sequence>

The API handlers sequence is the default, using org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler like this documentation. This handler should be the responsible to apply global mediators.

Is there some known bug with a workaround or, maybe, did I some mistake?

  • It should work if the file is deployed properly. Did you observe any errors in the log while it's being deployed? – Bee Jun 06 '18 at 16:09
  • Yes. The application log shows given message:INFO - DependencyTracker Sequence : WSO2AM--Ext--In was added to the Synapse configuration successfully – marceloavan Jun 06 '18 at 19:19
  • Another detail that I could observe is that the logs from APIManagerExtensionHandler are not logged. I think that there is some throuble in synapse handlers. – marceloavan Jun 06 '18 at 19:20
  • The "yes" on the last comment was about the log, but I did not abserve any error. – marceloavan Jun 07 '18 at 11:02
  • If your API published? If is in prototype mode, check my answer in https://stackoverflow.com/questions/50624765/wso2-apim-custom-sequences-for-non-published-apis-setting-variable/50656421#50656421 – Sourcerer Jun 12 '18 at 16:23
  • Yes, my api is published, and the API XML generated using the template that you mentioned in your question contains the entry with APIManagerExtensionHandler. Do you have another idea? – marceloavan Jun 15 '18 at 12:58

0 Answers0