1
votes

I have written a Websphere MQ listener using Spring boot (JMS). I have configured the backout queue at queue level with threshold as 0

As part of program I am throwing JMSException immediately I receive message so that my message goes to back out queue.

The problem that I am facing is that message is getting continuously re-delivered to listener

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");

}
1
Till now I have investigated only the application logs not the queuemanager logs... Yes the same user have access to put the message in backout queueLalit Kumar
I will try it on friday and share my findings... thanks a lotLalit Kumar
Did setting the BOTHRESH to 1 or higher solve this issue? If this helped resolve your issue please accept my answer.JoshMc

1 Answers

2
votes

BOTHRESH must be greater than or equal to 1. Setting BOTHRESH to 0 disables it.

Reference the How WebSphere Application Server handles poison messages by IBM's Paul Titheridge.

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.