Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Suspending and resuming an instance via the CLI


In this recipe, we will learn how to suspend an instance without killing active requests. Once the running requests are completed, the next ones will not be accepted. This is a new feature available in WildFly 9.

Getting ready

To test this recipe, we will need the application named grace that you can find in my GitHub repository. If you skipped the Managing applications using the deployments folder recipe, please refer to it to download all the source code and the projects that you will need.

Start up your WildFly so we can directly connect to it via the CLI, as follows:

$ cd ~/WFC/wildfly
$ ./bin/standalone.sh

How to do it…

  1. First of all, deploy the application grace.war. Once the application has been deployed, open it using a browser at the following URL http://127.0.0.1:8080/grace

    This will hit the index.jsp page which increments a counter and then sleeps for 10 seconds, just to simulate a long running request.

  2. While running, open a terminal window...