Is there a way I can programmatically tell Wildfly to stop accepting new HTTP(S) and/or AJP requests? Ideally this would be via JMX.
I want to give it some time to finish any requests in progress, but I don't wish to accept any new requests, e.g. as part of a graceful shutdown (not really a suspend so much as a graceful shutdown so that other cluster nodes pick up the new requests and an attempt is made to finish requests in progress before shutting down this node).
Note that I don't actually need any help tracking active requests -- I have my own servlet filter doing that. I just need Wildfly to enter a state where it won't accept any new requests but won't terminate existing requests. I don't even need it to be able to exit this state -- as a shutdown is the next step.
I note that there is some graceful "suspend" capability -- but this doesn't appear to exist in 8.1.0. Is it new to 8.2.0? If so, I still don't see documentation on how to invoke it except via the CLI, whereas I want to invoke it programmatically from within Wildfly itself. Is there any workable approach in 8.1.0?
Any help would be greatly appreciated.
Graceful shutdown is a new feature available in WildFly 9.
you could do :shutdown(timeout=600) to put server into suspend state and wait for 600 seconds for all old requests to be processed and than shutdown.
there are also few other options but in general i think this is what you want. Also request tracking comes in WFLY9 by default as this is needed to do graceful shutdown correctly.