Websphere MQ 7with Spring JMS - 无限交付
Websphere MQ 7with Spring JMS - infinite delivery
我使用 Spring 引导 (JMS) 编写了一个 Websphere MQ 侦听器。我在队列级别配置了回退队列,阈值为 0
作为程序的一部分,我在收到消息后立即抛出 JMSException,以便我的消息返回队列。
我面临的问题是消息不断地重新传送给侦听器
JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: ID:414d51204d5148554244313020202020583e8e2b26af9905
JMSTimestamp: 1484639118180
JMSCorrelationID: null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: true
JMSXAppID: WebSphere MQ Client for Java
JMSXDeliveryCount: 98
JMSXUserID: a450922
JMS_IBM_Character_Set: UTF-8
JMS_IBM_Encoding: 546
JMS_IBM_Format: MQSTR
JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 28
JMS_IBM_PutDate: 20170117
JMS_IBM_PutTime: 07451818
@JmsListener(destination = "${ibm.mq.incomingqueue}", containerFactory = "defaultJmsListenerContainerFactory")
public void onMessage(TextMessage message) throws JMSException {
System.out.println("Here" + message.toString());
throw new JMSException("reason");
}
BOTHRESH 必须大于或等于 1
。将 BOTHRESH 设置为 0
将禁用它。
参考 IBM 的 How WebSphere Application Server handles poison messages
保罗·提瑟里奇。
When WebSphere MQ is the JMS provider
By default, queues created with WebSphere MQ have the Backout threshold property (known in WebSphere MQ terms as BOTHRESH) set to 0. Therefore, the default behaviour of WebSphere MQ is never to back out poison messages.
我使用 Spring 引导 (JMS) 编写了一个 Websphere MQ 侦听器。我在队列级别配置了回退队列,阈值为 0
作为程序的一部分,我在收到消息后立即抛出 JMSException,以便我的消息返回队列。
我面临的问题是消息不断地重新传送给侦听器
JMSMessage class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: ID:414d51204d5148554244313020202020583e8e2b26af9905
JMSTimestamp: 1484639118180
JMSCorrelationID: null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: true
JMSXAppID: WebSphere MQ Client for Java
JMSXDeliveryCount: 98
JMSXUserID: a450922
JMS_IBM_Character_Set: UTF-8
JMS_IBM_Encoding: 546
JMS_IBM_Format: MQSTR
JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 28
JMS_IBM_PutDate: 20170117
JMS_IBM_PutTime: 07451818
@JmsListener(destination = "${ibm.mq.incomingqueue}", containerFactory = "defaultJmsListenerContainerFactory")
public void onMessage(TextMessage message) throws JMSException {
System.out.println("Here" + message.toString());
throw new JMSException("reason");
}
BOTHRESH 必须大于或等于 1
。将 BOTHRESH 设置为 0
将禁用它。
参考 IBM 的 How WebSphere Application Server handles poison messages 保罗·提瑟里奇。
When WebSphere MQ is the JMS provider By default, queues created with WebSphere MQ have the Backout threshold property (known in WebSphere MQ terms as BOTHRESH) set to 0. Therefore, the default behaviour of WebSphere MQ is never to back out poison messages.