IBM MQ message-driven bean pause in WebSphere Liberty
The maxSequentialDeliveryFailures property for an activation specification defines the maximum number of sequential message delivery failures to a message-driven bean (MDB) instance that the resource adapter tolerates before pausing the MDB.
Before you begin
You need to be aware of the set of events that might cause an MDB to pause in WebSphere® Liberty. The resource adapter considers any one of the
following as a message delivery failure:
- An unchecked exception being thrown from the onMessage method of the MDB.
- A
JMSExceptionoccurring in the processing of the resource adapter, prior to delivering the message to the MDB. - A
JMSExceptionoccurring in the processing of the resource adapter, post delivering the message to the MDB. - The XA transaction, or local transaction, used to consume the message being rolled-back.
- No thread being available in the application server to deliver the message to the MDB.
About this task
The default value of the maxSequentialDeliveryFailures property is
-1, which means that the MDB is never paused. Any other negative value is
treated the same as -1. A value of:
- 0 means that the MDB pauses on the first error
- 1 means that the MDB pauses on two sequential errors
- 2 means that the MDB pauses on three sequential errors, and so on
You can configure this property for an activation specification, only in WebSphere Liberty, and when the level of Liberty is 18.0.0.4, or higher.
Attention: If you set the attribute to a non-default value in any application server environment other than
Liberty, the value will be ignored and a
warning message written to the log.
In addition, it is possible to install the IBM® MQ resource adapter into WebSphere Liberty as a generic resource adapter. Doing this disables all of the IBM MQ and WebSphere Application Server integration capabilities, and prevents the resource adapter from being able to detect that it is running in Liberty. Therefore, setting maxSequentialDeliveryFailures to be greater than or equal to 0 is not supported, and results in a warning message in the log.
Procedure
In WebSphere Liberty, specify the
maxSequentialDeliveryFailures property on the definition of an activation
specification within the server.xml.
For
example:
<jmsActivationSpec>
<properties.wmqJms destinationRef="jndi/MDBQ"
transportType="BINDINGS"
queueManager="MQ21"
maxSequentialDeliveryFailures="1"/>
</jmsActivationSpec>