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:

:suspend

Check from the server logs that the status has changed to suspended:

wildfly 9 suspend resume

You can also specify a timeout, to force requests to complete by that time:

:suspend(timeout=60)

In Domain mode, to suspend all servers:

:suspend-servers(timeout=60)

In Domain mode, to suspend a single server:

/host=master/server-config=server-one:suspend(timeout=60)

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:

wildfly 9 tutorial

Once completed the running requests, you can either shutdown the server or resume the execution with:

:resume
0
0
0
s2sdefault

Related articles available on mastertheboss.com

Wildfly 8 introduction

JBoss AS has a new name: as you probably know future versions of

Configuring Eclipse to use WildFly

How do I integrate WildFly with Eclipse? This tutorial shows how

Maven configuration for Java EE 7 projects on WildFly

In this tutorial we will learn how to configure Maven Project Obj

Running WildFly with JDK 8

The JDK 1.8 early access is available for download at Oracle's si

Patching WildFly application server

The final version of WildFly 8.1.0 has been released and it conta

Configuring WildFly Batch Job Repository

WildFly ships with a subsystem named batch which is the administr