6) Start another fresh ESB with port offSet 10, that ESB will use the service(echo) hosting endpoint.

7. Start all the servers. Now if you refresh HAproxy stats page, you can see the colors are changed according to the server status.

Green - Active ESB worker (esb-01)

Blue - Passive ESB worker(esb -02)

Now you should see the following info logs in the ESB nodes (worker) due to health check of the

HAproxy.

8. Create a SOAPUI project for the proxy service and send a requests through the HAproxy.

http://xxx.xx.com:90/services/EchoProxy

Now you should observe that the HAproxy send the request only to the esb-01. Because in above HAproxy config, we have mentioned that the worker esb-02 as the backup instance.

9. Now create new load test (in SoapUI project ) using that Request1 and start the load test. So now you should see still the esb-01 is responding, then shut down the esb-01 while load is sending to HAproxy. When esb-01 is shutting down HAproxy will dispatch the request to the backup esb-02 and it will start responding to the requests.

10. Start the esb-01 again, Now you should see that HAproxy dispatch all the request back to esb-01 and esb-02 stop responding.

Active/Active worker ESB.

Now if you want to achieve the active/active setup, remove the “backup” property from the esb-02 configuration of the HAproxy settings (/etc/haproxy/haproxy.cfg) and restart the HAproxy.(No need to restart the ESB nodes)

sudo service haproxy restart

11. Start the load test again, Now you should see both workers (active/active) are responding and HAproxy sending the request to the workers in roundrobin manner.

In my next post i’m planning to discuss about the SSL configurations with HAproxy.