我正在使用带有RabbitMQ的WSO2 ESB,我有两个代理服务:
AMQPProducerSample
,它通过HTTP传输接收消息并将其发送到RabbitMQ队列AMQPProxy
它作为RabbitMQ队列的消费者(通过rabbitmq传输),消耗的消息被发送到HTTP端点SampleEndPoint
除了一种情况外,一切正常:
SampleEndPoint
中设置的后端服务已关闭。新邮件到达并通过AMQPProducerSample
发布,传递失败(预计会因为我的后端已关闭)。在控制台中我可以看到:
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]
我的后端服务恢复并可用
AMQPProducerSample
发布,但我的端点不再收到任何消息。只有当未传递的消息数低于5时,它才能正常工作。在这种情况下,消息会成功传递到后端服务。在传递了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&rabbitmq.server.port=5672&rabbitmq.queue.name=queue&rabbitmq.queue.routing.key=route&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>
答案 0 :(得分:1)
您必须在transportReceiver中为axis2.xml中的rabbitmq更改以下参数
function MyClass(objs)
{
var _objs = objs;
this.showNames = function () {
var s = "Names: ";
for (var obj in _objs) {
s += obj.getName();
}
console.log(s);
};
}
function MyObj(name)
{
var _name = name;
this.getName = function () { return _name; };
}
var mc = new MyClass({ 'M': new MyObj("morning"), 'D': new MyObj("Day") });
mc.showNames();
“rabbitmq.connection.retry.count”是每次重试后尝试重新连接的次数,我认为您已将其设置为5,这就是五次尝试后连接断开的原因。增加参数值并尝试。
答案 1 :(得分:1)
这是ESB 4.8.1新包装中的一个已知错误。后来我们修好了。因此,我建议您切换到修复此问题的ESB 4.9.0版本。
[1] https://docs.wso2.com/display/ESB490/Downloading+the+Product