Since WildFly 9 you have the ability to suspend/resume the execution of the Application Server. This new feature allows your existing request to complete while preventing new requests to be accepted.
In order to do that, enter the CLI and execute:
Check from the server logs that the status has changed to suspended:
You can also specify a timeout, to force requests to complete by that time:
In Domain mode, to suspend all servers:
In Domain mode, to suspend a single server:
What exactly happens in the subsystems when WildFly has been suspended?
- undertow: The undertow subsystem will wait for all HTTP/HTTPS requests to finish.
- mod_cluster: The modcluster subsystem will notify the load balancer that the server is going to be suspended.
- ejb: The ejb3 subsystem will wait for all remote EJB requests and MDB message deliveries to finish. However, delivery to MDBs is stopped in the PRE_SUSPEND phase. EJB timers are suspended as well.
- JEE Concurrency: The server will wait for all active jobs to finish. All queued jobs will be skipped.
Therefore, when you are in suspend mode you are still able to:
- Deploy/undeploy applications
- Change your configuration
You can check at any time the status of your server by issuing an ls at the root of your configuration:
[standalone@localhost:9990 /] ls core-service name=francesco-pc deployment namespaces= deployment-overlay process-type=Server extension product-name=WildFly Full interface product-version=9.0.0.Beta2 path profile-name=undefined socket-binding-group release-codename=Kenny subsystem release-version=1.0.0.Beta2 system-property running-mode=NORMAL launch-type=STANDALONE schema-locations= management-major-version=3 server-state=running management-micro-version=0 suspend-state=SUSPENDED management-minor-version=0
On the other hand, new application requests will receive a:
Once completed the running requests, you can either shutdown the server or resume the execution with: