Wso2 MaximumConcurrentAccess的问题
我想将我的服务限制为最多同时执行3次并发执行,因此我使用throttle mediator,maximunconcurrentcacces为3。 设置此属性仅允许我使用此服务三次,之后,始终响应错误:onReject中定义的异常。要重新开始,我必须重新部署服务 我想我忘了一些配置,但我不知道。我在wso2文档中找不到它:(.我的代理代码如下:Wso2 MaximumConcurrentAccess的问题,wso2,wso2esb,Wso2,Wso2esb,我想将我的服务限制为最多同时执行3次并发执行,因此我使用throttle mediator,maximunconcurrentcacces为3。 设置此属性仅允许我使用此服务三次,之后,始终响应错误:onReject中定义的异常。要重新开始,我必须重新部署服务 我想我忘了一些配置,但我不知道。我在wso2文档中找不到它:(.我的代理代码如下: <proxy xmlns="http://ws.apache.org/ns/synapse" name="PruebaT" transp
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="PruebaT"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<throttle id="AAA">
<policy>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
<throttle:ThrottleAssertion>
<throttle:MaximumConcurrentAccess>3</throttle:MaximumConcurrentAccess>
</throttle:ThrottleAssertion>
</wsp:Policy>
</policy>
<onReject>
<log level="custom">
<property name="text" value="**Access Denied**"/>
</log>
<makefault version="soap11">
<code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
<reason value="**Access Denied**"/>
</makefault>
<property name="RESPONSE" value="true"/>
<header name="To" action="remove"/>
<send/>
<drop/>
</onReject>
<onAccept>
<log level="custom">
<property name="text" value="**Access Accept**"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:8090/dummywar/inicio?file=response.xml"/>
</endpoint>
</send>
</onAccept>
</throttle>
</inSequence>
</target>
</proxy>
3.
谢谢。根据WSO2文档,当throttle mediator用于并发访问限制时,必须在响应流上触发相同的throttle mediator id,以便从可用限制中扣除已完成的响应。(即请求流和响应流中具有相同id属性的节流调解器的两个实例) < P> >根据油门中介逻辑,在你的情况下,你已经把油门顺序放进去了,所以ESB不能识别哪个请求已经完成。你必须把它放在外面。否则,ESB会考虑三个请求不完整,你会得到访问拒绝的消息。 所以配置应该是这样的
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="PruebaT"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<throttle id="AAA">
<policy>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
<throttle:ThrottleAssertion>
<throttle:MaximumConcurrentAccess>3</throttle:MaximumConcurrentAccess>
</throttle:ThrottleAssertion>
</wsp:Policy>
</policy>
<onReject>
<log level="custom">
<property name="text" value="**Access Denied**"/>
</log>
<makefault version="soap11">
<code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
<reason value="**Access Denied**"/>
</makefault>
<property name="RESPONSE" value="true"/>
<header name="To" action="remove"/>
<send/>
<drop/>
</onReject>
<onAccept>
<log level="custom">
<property name="text" value="**Access Accept**"/>
</log>
<send>
<endpoint>
<address uri="http://krishan-Latitude-E5450:8080/ep1"/>
</endpoint>
</send>
</onAccept>
</throttle>
</inSequence>
<outSequence>
<throttle id="AAA"/>
<send/>
</outSequence>
</target>
<description/>
</proxy>
3.
您使用的ESB版本是什么?欢迎您,您可以接受这一正确答案。:)