ibm-messaging / mq-jms-spring

Components to assist MQ JMS integration with Spring frameworks
Apache License 2.0
189 stars 102 forks source link

unexpected backout behaviour with DMLC and Websphere MQ #79

Closed apinske closed 2 years ago

apinske commented 2 years ago

I already reported this to Spring: https://github.com/spring-projects/spring-framework/issues/27987 But might be interesting to document here as well.

Websphere MQ has a strange way of backout handling (i.e. moving poison messages). It does not move poison messages to the backout queue immediately on the "final" rollback, but only increments the internal BackoutCount (to be one more than it should be able to be) and leaves the message on the initial queue. The actual move is performed in a subsequent (unrelated!) receive-call. This is documented here.

DMLC uses a polling approach and thus is susceptible to the described behaviour. It is not really possible to observe this behaviour, as any attempt to "see" the messages moves it to the right queue. Only way is to "not observe" the message already being in the backout queue.

The practical implications are two-fold:

ibmmqmet commented 2 years ago

I'm not really clear what you think the problem is. But in any case, any application that uses the MQ JMS classes in either a synchronous or asynchronous (usually something like a JEE MDB) fashion will be building on the documented behaviour. If you want to suggest a change to MQ's JMS code, then you can always raise an idea here. But there's nothing that can be done at this layer to change it.

apinske commented 2 years ago

My thoughts were:

I don't think most users of this lib (or boot for that matter) even recognise that the docs about "receives messages synchronously" apply to them, i.e. that spring uses a polling approach for message listeners.

I also voted/commented on https://integration-development.ideas.ibm.com/ideas/MESNS-I-190.