简体   繁体   English

wso2 esb中的故障转移配置

[英]Failover configuration in wso2 esb

We have a proxy service that does the following 1. calls a backend service to get the client id 2. use the endpoint (client endpoint) configured for that client id and forward the original request to that endpoint. 我们有一个代理服务,该代理服务执行以下操作:1.调用后端服务以获取客户端ID。2.使用为此客户端ID配置的端点(客户端端点),并将原始请求转发到该端点。 3. return a response to the request 3.返回对请求的响应

Earlier we were setting OUT_ONLY property to true while forwarding the request to the client endpoint (step 2). 早些时候,我们在将请求转发到客户端端点时将OUT_ONLY属性设置为true(第2步)。 But we now have to use a failover endpoint configuration for the client endpoint. 但是我们现在必须对客户端端点使用故障转移端点配置。 So we removed the OUT_ONLY property and used the following failover configuration. 因此,我们删除了OUT_ONLY属性,并使用了以下故障转移配置。 The client endpoint does not return any response for the forwarded requests. 客户端端点不对转发的请求返回任何响应。 Due to this the callback that gets registered does not get any response and it gets cleared by the Timeouthandler subsequently. 因此,注册的回调不会获得任何响应,并且随后将被Timeouthandler清除。 Recently we are facing some CPU spikes and OutOfMemory errors getting thrown by ESB. 最近,我们面临着一些CPU高峰和ESB抛出的OutOfMemory错误。 We suspect that the synapse callback handler is utilizing most of the system resources and unable to recover. 我们怀疑突触回调处理程序正在利用大多数系统资源,并且无法恢复。 Could this configuration create any OutOfMemory errors (if stress tested) as there is no response returned by the client endpoint? 由于客户端端点没有返回响应,因此此配置是否可以创建任何OutOfMemory错误(如果经过压力测试)? Please suggest. 请提出建议。

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="client_forward_endpoint_110">
<failover>
    <endpoint name="primary">
        <address uri="--primary endpoint--">
            <enableAddressing />
            <timeout>
                <duration>30</duration>
                <action>discard</action>
            </timeout>
            <markForSuspension>
                <errorCodes>101504, 101505, 101500</errorCodes>
                <retriesBeforeSuspension>3</retriesBeforeSuspension>
                <retryDelay>1</retryDelay>
            </markForSuspension>
            <suspendOnFailure>
                <initialDuration>1000</initialDuration>
                <progressionFactor>2</progressionFactor>
                <maximumDuration>64000</maximumDuration>
            </suspendOnFailure>
        </address>
    </endpoint>
    <endpoint name="secondary">
        <address uri="--secondary endpoint--">
            <enableAddressing />
            <timeout>
                <duration>30</duration>
                <action>discard</action>
            </timeout>
            <markForSuspension>
                <errorCodes>101504, 101505, 101500</errorCodes>
                <retriesBeforeSuspension>3</retriesBeforeSuspension>
                <retryDelay>1</retryDelay>
            </markForSuspension>
            <suspendOnFailure>
                <initialDuration>1000</initialDuration>
                <progressionFactor>2</progressionFactor>
                <maximumDuration>64000</maximumDuration>
            </suspendOnFailure>
        </address>
    </endpoint>
</failover>

If your endpoint doesn't return any response, how can you tell if it is active? 如果您的端点未返回任何响应,您如何确定它是否处于活动状态?

If there is any kind of response from the endpoint to any kind of request, you may be able to do a more complicated mediation using first a 'call' mediator to check endpoint availability, then a send mediator with the OUT_ONLY property. 如果端点对任何类型的请求有任何类型的响应,则您可以使用第一个“呼叫”调解器检查端点可用性,然后使用具有OUT_ONLY属性的发送调解器进行更复杂的调解。 You may use a switch mediator for evaluating the result of the 'call' mediator, and set a very short timeout for that mediator to make the throughput acceptable even if the first endpoint is inaccessible. 您可以使用切换介体来评估“呼叫”介体的结果,并为该介体设置非常短的超时,以使吞吐量可以接受,即使第一个端点不可访问。 It would not be an ideal solution, but it should work. 这不是一个理想的解决方案,但它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM