Mule JMS Max Redelivery超过Sonic和WMQ

时间:2014-03-03 20:33:45

标签: exception jms mule ibm-mq sonic

我有一个mule流,它从声音主题中读取消息并发布到Websphere MQ主题。 流程是同步和交易的。 我在inboud端点设置了maxRedelivery =“10”。但它一直试图重新开始。 这是我得到的例外:

ERROR 2014-03-03 15:13:08,763 [JMS Session Delivery Thread - $TMPAPPID$544239$$SESSION$0:-3441129419112818566]    org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : "Message with id "ID:1419c04f:da190005:1448992ACB1" has been redelivered 1,511 times on  endpoint "jms://topic:testtopic", which exceeds the maxRedelivery setting of 10 on the connector "sonicMQConnectorSub".  Message payload is of type: TextMessage
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. "Message with id "ID:1419c04f:da190005:1448992ACB1" has been redelivered 1,511 times on endpoint "jms://topic:testtopic", which exceeds the maxRedelivery setting of 10 on the connector "sonicMQConnectorSub". Message payload is of type: TextMessage (org.mule.transport.jms.redelivery.MessageRedeliveredException)
  org.mule.transport.jms.redelivery.JmsXRedeliveryHandler:91 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/jms/redelivery/MessageRedeliveredException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.transport.jms.redelivery.MessageRedeliveredException: "Message with id "ID:1419c04f:da190005:1448992ACB1"   has been redelivered 1,511 times on endpoint "jms://topic:testtopic", which exceeds the maxRedelivery setting of 10 on   the connector "sonicMQConnectorSub". Message payload is of type: TextMessage
    at org.mule.transport.jms.redelivery.JmsXRedeliveryHandler.handleRedelivery(JmsXRedeliveryHandler.java:91)
    at org.mule.transport.jms.MultiConsumerJmsMessageReceiver$JmsWorker.preProcessMessage(MultiConsumerJmsMessageReceiver.java:426)
    at org.mule.transport.AbstractReceiverWorker$1$1.process(AbstractReceiverWorker.java:120)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

这是我使用的流程。

<jms:connector name="sonicMQConnectorSub" specification="1.1" validateConnections="true"  maxRedelivery="10" connectionFactory-ref="soniqMQConnectionFactorySub" doc:name="JMS" clientId="${topic.sub.clientId}" durable="true"/>
<spring:beans>
    <spring:bean id="soniqMQConnectionFactoryBeanSub" name="soniqMQConnectionFactorySub" class="progress.message.jclient.ConnectionFactory">
        <spring:property name="connectionURLs" value="${topic.sub.providerUrls}" />
        <spring:property name="defaultUser" value="${topic.sub.username}" />
        <spring:property name="defaultPassword" value="${topic.sub.password}" />
    </spring:bean>
</spring:beans>

<jms:connector name="wsMQConnector" specification="1.1" username="${topic.pub.username}" password="${topic.pub.password}" validateConnections="true" connectionFactory-ref="wsMQConnectionFactory" doc:name="JMS" clientId="${topic.pub.clientId}"/>
<spring:beans>
    <spring:bean id="wsMQConnectionFactory" class="com.ibm.mq.jms.MQTopicConnectionFactory">
        <spring:property name="transportType" value="1"/>
        <spring:property name="hostName" value="${topic.pub.host}"/>
       <spring:property name="port" value="${topic.pub.port}"/>
        <spring:property name="channel" value="${topic.pub.channel}"/>
        <spring:property name="queueManager" value="${topic.pub.queueManager}"/>
    </spring:bean>
</spring:beans>

<flow name="Flow1" doc:name="Flow1" processingStrategy="synchronous">
    <jms:inbound-endpoint doc:name="JMS" connector-ref="sonicMQConnectorSub" topic="${topic.sub.name}" >
        <jms:transaction action="ALWAYS_BEGIN" /> 
    </jms:inbound-endpoint>
    <message-properties-transformer doc:name="Message Properties">           
        <add-message-property key="SENTTIMESTAMP" value="#[server.dateTime]"/>            
    </message-properties-transformer>
    <logger message="Payload: #[message.payload]" level="INFO" doc:name="Logger"/>
   <jms:outbound-endpoint doc:name="JMS" connector-ref="wsMQConnector" topic="${topic.pub.name}">
        <jms:transaction action="ALWAYS_JOIN" />
    </jms:outbound-endpoint> 

</flow>

1 个答案:

答案 0 :(得分:1)

这是预期的行为,当您的JMS提供程序已超出maxRedelivery中定义的最大重新传递计数时,会引发上述异常。请参阅David Dossot的答案:jms Mule max redelivery exceeded