This tutorial shows how you can shutdown WildFly gracefully.

WildFly can be suspended or shut down gracefully. This allows permits running requests to complete normally, without accepting new requests. Moreover, you can specify a timeout to define how long the suspend or shut down operation will wait for active requests to complete.

You can shutdown WildFly from the Command Line Interface as follows:

:shutdown

This command will trigger an immediate shutdown. The server will just care to close all socket bindings, however all active request will be abruptly teminated.

If you want to shut down the server gracefully, specify the timeout value, in seconds, for the server to wait for active requests to complete. The default is 0, which will shut down the server immediately. A value of -1 will cause the server to wait indefinitely for all active requests to complete before shutting down.

 :shutdown(timeout=60)

how to shutdown wildfly gracefully how to shutdown wildfly gracefully

In Domain mode, to stop all servers in a managed domain gracefully:

 :stop-servers(timeout=60)

In order to stop just a single server in a managed domain gracefully:

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

In order to stop all servers in a server group gracefully.

 /server-group=main-server-group:stop-servers(timeout=60)

Finally, if you want to ensure that your requests will be allowed to complete, without shutting down the server, then you need to suspend it. Check this tutorial to learn how to suspend WildFly: Suspending and resuming WildFly

0
0
0
s2sdefault

Related articles available on mastertheboss.com

JBoss MBeans POJO

JMX MBean services are the core building blocks of the JBoss Appl

How to a dump of JNDI tree with JMX console ?

#2 JBoss Howto. This is the recipe of the day

How to configure JBoss to bind to a different IP ?

If you want to change the jboss.bind.address property use the&nbs

How to shut down JBoss from remote ?

JBoss recipe of the day

How to create multiple instances of an Mbean?

  Supposing you need two instances of an MBean, let's say one fo

JBoss classloader issues

By default JBoss (prior to version 3.2) uses a flat class loading