Is it possible to reject http requests until my war is fully deployed ?

22 views
Skip to first unread message

Olivier Masseau

unread,
Jun 5, 2023, 12:30:35 PM6/5/23
to WildFly
Hello,

Here is my problem :
I need to load-balance two Wildfly instances (currently using Nginx as the load-balancer).

I have a webapp deployed on each instance.
The webapp takes about 30s to deploy.

Now here is the problem :
If I restart an instance, Wildfly accepts http requests to this instance immediatly even if my app is not fully deployed. It just makes the http requests wait until the app is fully deployed.

So that means that when an instance is restarted, I have potentially http requests waiting 30s before getting a response (The load balancer considers this instance OK as it is accepting http requests).

Question: Is there any way to make Wildfly reject http requests on the public interface until my app is fully deployed ?


Olivier Masseau

unread,
Jun 5, 2023, 12:45:05 PM6/5/23
to WildFly
I've just seen this in the documentation :

By default, WildFly starts up gracefully, meaning that incoming requests are queued or cleanly rejected until the server is ready to process them

So it seems my problem here is that they are queued and not cleanly rejected.
But the documentation does not specify how to make them cleanly rejected instead of queued.

Paul Ferraro

unread,
Jun 5, 2023, 10:15:03 PM6/5/23
to WildFly
You probably want to start your server in suspended mode, and manually resume when your application is fully deployed.

If your server hosts multiple deployments, you might want to consider using mod_cluster rather than nginx.
mod_cluster uses even-driven, application-based registration, and thus can proxy multiple deployments (with independent lifecycles) without this issue.

Reply all
Reply to author
Forward
0 new messages