2012-11-07 46 views
2

我在Red Hat 2.6.32上運行WSO2 ESB 4.5.1和Sun Java SE 1.6.0_33,並使用Apache ActiveMQ 5.5.1作爲ESB的持久存儲。計劃消息轉發處理器在X傳遞嘗試後不會停用

我想寫一個流程是:
1.讀取XML文件
2.地址信息保存在MQ隊列每個地址
3.具有從MQ讀取消息處理器,並嘗試向JMS端點
4.如果發送失敗消息處理器是停用本身

當JMS端點(另一臺服務器上運行的另一個ActiveMQ的實例)是放棄一切的偉大工程之前嘗試一個更交貨,但如果我停止作爲JMS端點的ActiveMQ,消息處理器不會停用爲I期望重試一次,但不斷嘗試從消息存儲重新發送相同的消息。出了什麼問題?

這裏是我有流量:

代理:

<proxy xmlns="http://ws.apache.org/ns/synapse" name="AddressPxy" transports="vfs" statistics="disable" trace="disable" startOnLoad="true"> 
<target> 
    <inSequence> 
    <property name="OUT_ONLY" value="true" scope="default" type="STRING"/> 
    <property name="target.endpoint" value="AddressesEP" scope="default" type="STRING"/> 
    <log level="full"/> 
    <iterate expression="//addresses/address"> 
     <target> 
      <sequence> 
       <store messageStore="AddressesMS"/> 
      </sequence> 
     </target> 
     </iterate> 
    </inSequence> 
    </target> 
    <parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter> 
    <parameter name="transport.PollInterval">15</parameter> 
    <parameter name="transport.vfs.MoveAfterProcess">file:///home/esb/sent</parameter> 
    <parameter name="transport.vfs.FileURI">file:///home/esb/addresses.xml</parameter> 
    <parameter name="transport.vfs.MoveAfterFailure">file:///home/esb/fail</parameter> 
    <parameter name="transport.vfs.ContentType">application/xml</parameter> 
    <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter> 
    <description></description> 
</proxy> 

消息存儲:

<messageStore name="AddressesMS" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse"> 
    <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter> 
    <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter> 
    <parameter name="store.jms.JMSSpecVersion">1.1</parameter> 
    <parameter name="store.jms.cache.connection">false</parameter> 
</messageStore> 

消息處理器:

<messageProcessor name="AddressesMP" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="AddressesMS" xmlns="http://ws.apache.org/ns/synapse"> 
    <parameter name="interval">10000</parameter> 
    <parameter name="max.delivery.attempts">1</parameter> 
</messageProcessor> 

端點:

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="AddressesEP"> 
    <address uri="jms:/Addresses?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://rhdev001:61616&transport.jms.DestinationType=queue"> 
    </address> 
</endpoint> 

我wso2carbon.log看到此錯誤消息:

TID: [0] [ESB] [2012-11-07 02:58:07,396] ERROR {org.apache.axis2.transport.jms.JMSSender} - Unable to create a JMSMessageSender for : null {org.apache.axis2.transport.jms.JMSSender} 
javax.jms.JMSException: Could not connect to broker URL: tcp://rhdev001:61616. Reason: java.net.ConnectException: Connection refused 
TID: [0] [ESB] [2012-11-07 02:58:07,398] ERROR {org.apache.synapse.message.processors.forward.BlockingMessageSender} - Error sending Message to url : jms:/Addresses?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://rhdev001:61616&transport.jms.DestinationType=queue {org.apache.synapse.message.processors.forward.BlockingMessageSender} 
org.apache.axis2.AxisFault: Unable to create a JMSMessageSender for : null 
TID: [0] [ESB] [2012-11-07 02:58:07,399] ERROR {org.apache.synapse.message.processors.forward.ForwardingJob} - Error Forwarding Message {org.apache.synapse.message.processors.forward.ForwardingJob} 
java.lang.Exception: Error while Sending Message 

希望有人能幫幫我!

回答

0

在此版本的ESB中消息處理器中的「max.delivery.attempts」參數存在一個小問題。但是你可以通過查看源代碼並將「max.delivery.attempts」改爲「max.deliver.attempts」來完成這項工作。

相關問題