Controlled shutdown of the X4 Server (via JMX)
How to shut down the X4 Server in a controlled way during processes are running
Prerequisites for shutting down
A controlled shutdown of the X4 Server ensures that all currently running processes are fully executed and no more processes are started. This requires that the property Can Stop is not set for processes that are not allowed to be stopped. Moreover, endless processes must be modeled in such a way that they interrupt processing at regular intervals so that they can be stopped.
Depending on the message queue adapter, this can be done as follows:
- JMS and RequestReply Transfer: Specify a timeout in parameter
timeout. If the adapter returns the status 0, the queue is empty and the process control goes back to the adapter, allowing the process to be halted. - MQ Series Transfer and WebSphere MQ: Enable the parameter
MQGetMessageOptions.options.MQC.MQGMO_WAITto activate waiting for a message, and specify in parameterMQGetMessageOptions.waitIntervala timeout in milliseconds that will be waited until an appropriate message can be received.
Access the MBean
X4ManagementStart the jconsole tool.
Open the MBean
X4Managementin a domainde.softproject.X4
Invoke the MBean method
setAllOutOfService().
The propertyOutOfServicewill be set for all processes. This causes that no more processes can be started.Invoke the MBean method
stopAllProcesses().
All processes that are currently executed and are allowed to be stopped, will be terminated.Wait until the MBean method
runningWorkflowCount()displays 0.
No process is executed any longer.Alternatively, you can also invoke the method
shutdownAllProcesses(longtimeoutInMS). This causes the MBean methodssetAllOutOfService(),stopAllProcesses(), andrunningWorkflowCount()to be executed consecutively.In ParamValue specify a timeout in milliseconds, to be handed over to the method as parameter
longtimeoutInMS.Click Invoke to execute the method. This returns
True, ifrunningWorkflowCount()displays0before the timeout exceeds.
Shut down the X4 Server.