1
hereというカスタムハンドラでWSO2 APIM 1.10.0を使用しています。WSO2 APIMハンドラのシーケンスを変更する方法
私は2つのグローバルカスタムハンドラを持っている:
- HeaderSwapHandler
- APIInforHandler
そしてAPIを作成するとき、次のように私はこれらの2つのカスタムハンドラシーケンスをしたいです。
<handlers>
<handler class="com.wso2.header.handler.HeaderSwapHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
<property name="apiImplementationType" value="ENDPOINT"/>
</handler>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler">
<property name="policyKey" value="gov:/apimgt/applicationdata/tiers.xml"/>
<property name="policyKeyApplication"
value="gov:/apimgt/applicationdata/app-tiers.xml"/>
<property name="id" value="A"/>
<property name="policyKeyResource"
value="gov:/apimgt/applicationdata/res-tiers.xml"/>
</handler>
<handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler"/>
<handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtGoogleAnalyticsTrackingHandler">
<property name="configKey" value="gov:/apimgt/statistics/ga-config.xml"/>
</handler>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/>
<handler class="com.wso2.header.handler.APIInforHandler"/>
</handlers>
上HeaderSwapHandler
及びハンドラの底部にAPIInforHandler
。
これを行う方法はありますか?
編集と
を解決私の元velocity_template.xml
は次のようである:私の問題を解決することができたの
<handlers xmlns="http://ws.apache.org/ns/synapse">
<handler class="com.wso2.header.handler.HeaderSwapHandler"/>
#foreach($handler in $handlers)
<handler xmlns="http://ws.apache.org/ns/synapse" class="$handler.className">
#if($handler.hasProperties())
#set ($map = $handler.getProperties())
#foreach($property in $map.entrySet())
<property name="$!property.key" value="$!property.value"/>
#end
#end
</handler>
#end
<handler class="com.wso2.header.handler.APIInforHandler"/>
</handlers>
#end
#end
#if($apiStatus == 'PROTOTYPED')
#end
## end of apiIsBlocked check
<handlers>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
<property name="inline" value="INLINE"/>
</handler>
</handlers>
</api>
:
<handlers xmlns="http://ws.apache.org/ns/synapse">
<handler class="com.wso2.header.handler.HeaderSwapHandler"/>
<handler class="com.wso2.header.handler.APIInforHandler"/>
#foreach($handler in $handlers)
<handler xmlns="http://ws.apache.org/ns/synapse" class="$handler.className">
#if($handler.hasProperties())
#set ($map = $handler.getProperties())
#foreach($property in $map.entrySet())
<property name="$!property.key" value="$!property.value"/>
#end
#end
</handler>
#end
</handlers>
#end
#end
#if($apiStatus == 'PROTOTYPED')
#end
## end of apiIsBlocked check
<handlers>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
<property name="inline" value="INLINE"/>
</handler>
</handlers>
</api>
ちょうどに変更。
Thanks @Bhathiya、ただ 'velocity_template.xml'ファイルが私の問題を解決できるでしょう。 – MikeWu