How do I limit the amount of times a JMS DefaultMessageListenerContainer will retry a message?

后端 未结 2 332
面向向阳花
面向向阳花 2021-01-18 04:14

I am using Spring JMS to connect to a Websphere MQ server. I implemented the SessionAwareListener interface to create a custom listener, reusing old code for the business lo

2条回答
  •  囚心锁ツ
    2021-01-18 05:06

    You can always check the JMSDeliveryCount. If it is more than the number you consider as maximum then just don't process the message and return.

    You can also configure your Websphere to move the bad message to the exception destination after some attempts.

提交回复
热议问题