我們使用spring集成連接到IBM MQ V7.5以從隊列中讀取消息。我們偶爾會收到大量的消息。 SI jms適配器無法讀取較大的消息,但適用於較小的消息。下面是我們得到的例外Spring集成 - IBM MQ - 從隊列中消耗大量消息
23:18:35,470 WARN DefaultMessageListenerContainer:839 - Setup of JMS message listener invoker failed for destination 'queue:///Cis.Orders' - trying to recover. Cause:
JMSWMQ2002: Failed to get a message from destination 'XXX'.;
nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '1' ('MQCC_WARNING') reason '2080' ('MQRC_TRUNCATED_MSG_FAILED').
com.ibm.msg.client.jms.DetailedMessageEOFException: JMSWMQ2002: Failed to get a message from destination 'Cis.Orders'.
WebSphere MQ classes for JMS attempted to perform an MQGET; however WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:524)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:216)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:124)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.getMsg(WMQConsumerShadow.java:1376)
at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.receiveInternal(WMQSyncConsumerShadow.java:227)
at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.receive(WMQConsumerShadow.java:1109)
at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.receive(WMQMessageConsumer.java:460)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receiveInboundMessage(JmsMessageConsumerImpl.java:766)
at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.receive(JmsMessageConsumerImpl.java:474)
at com.ibm.mq.jms.MQMessageConsumer.receive(MQMessageConsumer.java:212)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:430)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:310)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1102)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1094)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:991)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '1' ('MQCC_WARNING') reason '2080' ('MQRC_TRUNCATED_MSG_FAILED').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:204)
... 15 more
任何幫助,將不勝感激。謝謝你的時間。
「(MQCC_WARNING')原因'2080'('MQRC_TRUNCATED_MSG_FAILED')...」來自異常追蹤的頂部附近,表明系統中的任何一個組件都有一個最大長度,超過,或者你的真正長的消息需要很長的時間才能傳輸在傳輸完成之前超時的事情,然後無法處理部分消息。我建議在組件配置中尋找最大的消息大小或超時時間。 –
謝謝Artem,我增加了對jms通道的接收超時並仍然出現同樣的錯誤,我懷疑MQGET發送的默認緩衝區大小爲4MB,如果消息大於4MB,spring默認偵聽器應該捕獲此異常並執行另一個MQGET設置緩衝區大小數據長度。不確定我的理論是否正確。 – user3814196