user1044808
user1044808

Reputation: 11

Block Incoming requests to tomcat until server deploys completely

I have multiple wars deployed in tomcat with inter-dependencies. Unless the tomcat deploys successfully(i.e. all wars), I want to block all incoming user requests to the server as it causes an unnecessary overhead(error messages, exceptions etc). Can someone suggest a way to block incoming requests to tomcat until tomcat is completely deployed.

Thanks.

Upvotes: 1

Views: 379

Answers (1)

Sam Saffron
Sam Saffron

Reputation: 131112

A general practice used in many places is to use a load balancer in front and rotate a server in to production.

EG:

[Load Balancer]
   |       |
[Web1]  [Web2]

Step 1: 

[Load Balancer]
   |       |
[Web1]  [Take Web2 offline]

Step 2:

[Load Balancer]
   |       |
[Web1]  [deploy Web2] 

Step 3:

[Load Balancer]
   |       |
[Web1]  [Add Web2 to pool] 

The main issue with simply blocking all requests is that you will end up having multiple clients "stall" and feel that your site is not responsive during deployment.

Upvotes: 1

Related Questions