【问题标题】:Websphere MQ 7with Spring JMS - infinite deliveryWebsphere MQ 7with Spring JMS - 无限交付
【发布时间】:2017-01-17 10:21:50
【问题描述】:

我使用 Spring Boot (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");

}

【问题讨论】:

  • 到目前为止,我只调查了应用程序日志而不是 queuemanager 日志...是的,同一用户有权将消息放入回退队列中
  • 我会在星期五尝试并分享我的发现...非常感谢
  • 将 BOTHRESH 设置为 1 或更高是否解决了这个问题?如果这有助于解决您的问题,请接受我的回答。

标签: ibm-mq spring-jms


【解决方案1】:

BOTHRESH 必须大于或等于1。将 BOTHRESH 设置为 0 会禁用它。

参考 IBM 的 How WebSphere Application Server handles poison messages 保罗提瑟里奇。

当 WebSphere MQ 是 JMS 提供者时 默认情况下,使用 WebSphere MQ 创建的队列将回退阈值属性(在 WebSphere MQ 术语中称为 BOTHRESH)设置为 0。因此,WebSphere MQ 的默认行为是从不回退有害消息。

【讨论】:

    猜你喜欢
    • 2012-08-27
    • 2013-01-09
    • 2016-10-31
    • 2017-02-03
    • 2015-07-08
    • 1970-01-01
    • 2015-06-19
    • 2017-01-17
    • 2019-06-16
    相关资源
    最近更新 更多