我的代理收到一个参数来做出决定,我不想发送 endpoints ,如何在调用 endpoints 之前将其删除?
您可以使用 URLRewrite mediator . wso2库中有一个很好的例子,您也可以参考wso2官方文档
http://wso2.com/library/3297/
https://docs.wso2.com/display/ESB480/URLRewrite+Mediator
在我的解决方案中,当它等于propName = V1或propName = V2时,我删除查询
<inSequence> <property name="sw_prop" expression="$url:propName" scope="default" type="STRING"/> <property name="querystrings" expression="$axis2:REST_URL_POSTFIX"/> <rewrite inProperty="querystrings" outProperty="querystrings"> <rewriterule> <condition> <or> <equal type="url" source="query" value="propName=V1"/> <equal type="url" source="query" value="propName=V2"/> </or> </condition> <action type="remove" fragment="query"/> </rewriterule> </rewrite> <property name="REST_URL_POSTFIX" expression="get-property('querystrings')" scope="axis2"/> <switch source="get-property('sw_prop')"> <case regex="V1"> <send> <endpoint key="EP1"/> </send> </case> <case regex="V2"> <send> <endpoint key="EP2"/> </send> </case> <default> <send> <endpoint key="AggProxyEP"/> </send> </default> </switch> </inSequence>
2 回答
您可以使用 URLRewrite mediator . wso2库中有一个很好的例子,您也可以参考wso2官方文档
http://wso2.com/library/3297/
https://docs.wso2.com/display/ESB480/URLRewrite+Mediator
在我的解决方案中,当它等于propName = V1或propName = V2时,我删除查询