What’s the easiest or preferred way to deploy in Wildfly with zero downtime

deploymentjboss

We can use Apache Tomcat to deploy our wars without stopping our current application. To do this we just need use the sufix ##XXX in the name of our war (an example here).

How can we do this (zero downtime) with Wildfly?

What is the easiest way? What is the preferred one?

Best Answer

I do not think it is possible to go completely zero-downtime with single server instance. What you are looking for is blue green deployment.
Basically you need to have a web server in front of your server pool. You decide to roll out the new version so your pick a subset of your servers and drain them - do not accept any new connections and finish any pending requests(usually done on webserver/load balancer by disabling request forwarding to these servers). Once drained, you deploy the new version to these idle instances, test it and if everything is ok you enable them again and load balancer can send user requests to the new version. Then you take the rest of the servers that still run the old version of your app and repeat the same procedure - drain, update, test, enable.