Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WSO2 ESB:地址终结点在后端恢复后不恢复发送_Wso2_Rabbitmq_Wso2esb_Esb - Fatal编程技术网

WSO2 ESB:地址终结点在后端恢复后不恢复发送

WSO2 ESB:地址终结点在后端恢复后不恢复发送,wso2,rabbitmq,wso2esb,esb,Wso2,Rabbitmq,Wso2esb,Esb,我将WSO2 ESB与RabbitMQ一起使用,我有两个代理服务: amqproducersample,它通过HTTP传输接收消息并将其发送到RabbitMQ队列 amqproxy它作为RabbitMQ队列的使用者(通过RabbitMQ传输),消耗的消息被发送到HTTP端点SampleEndPoint 除了一种情况外,其他一切正常: SampleEndPoint中设置的我的后端服务将关闭 新邮件通过amqproducersample到达并发布,传递失败(这是因为我的后端已关闭)。在控制台中,

我将WSO2 ESB与RabbitMQ一起使用,我有两个代理服务:

  • amqproducersample
    ,它通过HTTP传输接收消息并将其发送到RabbitMQ队列
  • amqproxy
    它作为RabbitMQ队列的使用者(通过RabbitMQ传输),消耗的消息被发送到HTTP端点
    SampleEndPoint
除了一种情况外,其他一切正常:

  • SampleEndPoint
    中设置的我的后端服务将关闭
  • 新邮件通过
    amqproducersample
    到达并发布,传递失败(这是因为我的后端已关闭)。在控制台中,我可以看到:

    WARN - ConnectCallback Connection refused or failed for : mfb.localhost/127.0.0.1:80
    WARN - FaultHandler ERROR_CODE : 101503
    WARN - FaultHandler ERROR_MESSAGE : Error connecting to the back end
    WARN - FaultHandler ERROR_DETAIL : Error connecting to the back end
    WARN - FaultHandler ERROR_EXCEPTION : null
    WARN - FaultHandler FaultHandler : Endpoint [SampleEndPoint]
    
  • 我的后端服务已恢复并可用

  • 新消息通过
    amqproducersample
    到达并发布,但我的端点不再接收任何消息。只有当未传递的消息数低于5时,它才能正常工作。在这种情况下,消息将成功传递到后端服务。在5(五)封未送达的邮件之后,传递始终停止工作
  • 如何解决这个问题?我是否需要设置或更改任何选项以使其始终工作

    我正在使用WSO2 ESB 4.8.1

    以下是我的完整配置:

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://ws.apache.org/ns/synapse">
        <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
            <parameter name="cachableDuration">15000</parameter>
        </registry>
        <proxy name="AMQPProxy"
               transports="rabbitmq"
               startOnLoad="true"
               trace="enable">
            <description/>
            <target>
                <inSequence>
                    <log level="full"/>
                    <property name="OUT_ONLY" value="true"/>
                    <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
                    <send>
                        <endpoint key="SampleEndPoint"/>
                    </send>
                </inSequence>
            </target>
            <parameter name="rabbitmq.queue.name">queue</parameter>
            <parameter name="rabbitmq.connection.factory">AMQPConnectionFactory</parameter>
            <parameter name="rabbitmq.exchange.name">exchange</parameter>
            <parameter name="rabbitmq.queue.routing.key">route</parameter>
        </proxy>
        <proxy name="AMQPProducerSample"
               transports="http"
               startOnLoad="true"
               trace="disable">
            <description/>
            <target>
                <inSequence>
                    <property name="OUT_ONLY" value="true"/>
                    <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
                    <property name="NO_KEEPALIVE" value="true" scope="axis2"/>
                    <send>
                        <endpoint>
                            <address uri="rabbitmq:/AMQPProxy?rabbitmq.server.host.name=localhost&amp;rabbitmq.server.port=5672&amp;rabbitmq.queue.name=queue&amp;rabbitmq.queue.routing.key=route&amp;rabbitmq.exchange.name=exchange"/>
                        </endpoint>
                    </send>
                </inSequence>
                <outSequence>
                    <send/>
                </outSequence>
            </target>
        </proxy>
        <endpoint name="SampleEndPoint">
            <address uri="http://mfb.localhost/">
                <timeout>
                    <duration>1000</duration>
                    <responseAction>discard</responseAction>
                </timeout>
                <suspendOnFailure>
                    <errorCodes>-1</errorCodes>
                    <progressionFactor>1.0</progressionFactor>
                </suspendOnFailure>
                <markForSuspension>
                    <errorCodes>-1</errorCodes>
                </markForSuspension>
            </address>
        </endpoint>
        <sequence name="fault">
            <log level="full">
                <property name="MESSAGE" value="Executing default 'fault' sequence"/>
                <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
                <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
            </log>
            <drop/>
        </sequence>
        <sequence name="main">
            <in>
                <log level="full"/>
                <filter source="get-property('To')" regex="http://localhost:9000.*">
                    <send/>
                </filter>
            </in>
            <out>
                <send/>
            </out>
            <description>The main sequence for the message mediation</description>
        </sequence>
    </definitions> 
    
    
    15000
    队列
    AMQP连接工厂
    交换
    路线
    1000
    丢弃
    -1
    1
    -1
    消息中介的主序列
    
    您必须在axis2.xml中transportReceiver for rabbitmq中更改以下参数

    <parameter name="rabbitmq.connection.retry.count" locked="false">5</parameter>
    
    5
    

    “rabbitmq.connection.retry.count”是每次重试后尝试重新连接的次数,我认为您已将其设置为5,这就是为什么在五次尝试后连接会断开。增加参数值并重试。

    这是ESB 4.8.1 fresh pack中存在的已知错误。后来我们把它修好了。因此,我建议您切换到ESB4.9.0版本,在该版本中此问题已得到修复


    [1]

    不幸的是,它不起作用。据我所知,此选项适用于ESB和RabbitMQ服务器之间的连接。在我的例子中,ESB(HTTP端点)和我的后端服务器之间存在问题。我今天进行了一些调试(ESB在调试模式下运行),发现连接线程在出现故障时不会从线程轮询中删除。线程轮询大小硬编码为5个线程,因此在5次失败后,交付停止工作。似乎ESB 4.8.1 fresh copy对此不支持,稍后使用正式补丁时,此问题已得到修复,因此如果没有补丁,我们无法添加参数“5”。但在最新的ESB版本4.9.0中,这一问题已经得到了修复。我完全惊讶于在以前的版本(4.8.1)中,补丁并没有修复如此严重的错误。无论如何,我们按照您的建议将ESB升级到了最新版本(4.9.0)。这个错误是用ESB 4.8.1版本中的补丁修复的。您能告诉我它是在哪个补丁中修复的吗?我刚刚应用了我在这里找到的所有修补程序:但问题仍然存在于4.8.1这些修补程序对公众不可用。它仅适用于获得生产支持的人员。