We are migrating applications from WebSphere Application Server Full profile (WAS) to Open liberty (OL)
One of the pattern we have is to consume a Queue in "strict FIFO order" for some JMS Queue. Many occurrences of the application are running concurrently ("cluster members" in WAS, "pods" in kubernetes/statefulset/docker for OL).
To implement FIFO, one and only one "JMS Activation" process/MDB can consume the Queue and if an exception occurs, stop the listener (JMS Activation)
In WAS, we can do this by
- setting
"WAS_EndpointInitialState"
to"ACTIVE"
on the JMS Activation for one server and"INACTIVE"
for the others - set
"Maximum server sessions"
to 1 on the JMS Activation - check
"Stop endpoint if message delivery fails"
- monitor the logs to see if the activations stopped
In OL we can in"server.xml"
:
- set
"autoStart="true"
on the"jmsActivationSpec"
stanza for one of the process and"false"
for the others - set
"maxEndpoints="1"
on the"jmsActivationSpec"
But how to make the activation stop in case of the application throw an exception in the"onMessage"
method in the MDB?
[EDIT 1 After @JoshMc comment]
Currently, the message is moved to the DLQ and the activation never seem to stop, so FIFO is broken as the next message in the Queue is consumed...
Currently, when the "onMessage()"
method throws an exception, the message is put back on the Queue, and immediately reprocessed, endlessly
The setting in"server.xml"
to connect to IBM MQ from OL is done as decribed here
[EDIT 2]
This feature (stop the activation in case of failure) is implemented in IBM MQ rar v9.1.1 and WebSphere Liberty 18.0.0.4 by setting the "maxSequentialDeliveryFailures"
property on the activation spec in this RFE. It does not work on Open Liberty v19.0.0.2 and IBM MQ rar v9.1.1. The rar specifically targets WebSphere Liberty to apply the property as cofirmed after activating traces on the connector:
March 7, 2019 1:17:38 EST PM[Default Executor-thread-7] ResourceAdapterImpl
WMQ messaging : '9.1.1.0-p911-L181120.1'.
MQJCA5003: 'maxSequentialFailureCount' cannot be set outside Websphere Liberty Profile
So the question is still there: How to make the activation stop in case of the"onMessage"
method in the MDB fails to consume the message? Open a RFE to IBM MQ asking to port the feature to Open Liberty?