0

I have coded a Spring MVC Hibernate application with RabbitMQ as a messaging server & a MySQL DB. I have also used Hazelcast an in-memory distributed cache to centralize the state of the application, moving the local tomcat session to a centralized session & implementing distributed locks.

The app right now is hosted on a single tomcat server in my local system.

I want to test my application on a multiple JVM node environment i'e app running on multiple tomcat servers.

What would be the best approach to test the app.

Few things that come to my mind

A. Install & configure a load balancer & set up a tomcat cluster in my local system. This I believe is a tedious task & requires much effort.

B. Host the application on a PAAS like OpenShift, cloudfoundry but I am not sure if I will be able to test my application on several nodes.

C. Any other way to simulate a clustered environment on my local windows system?

2 Answers 2

1

I would suggest first you should understand your application requirement. For the real production/live environment, are you going to use Infrastructure as a service or PAAS.

If Infrastructure as a service then I would suggest create local cluster environment and use the tomcat and spring application sticky session concept. Persist the session in Hazelcast or redis server installed on different node. Configure load balancer for multiple nodes having tomcat server. 2-3 VMs for testing purpose would be suitable.

If requirement is PAAS then Don't think about local environment. Test directly on OpenShift or AWS free account and trust me you would be able to test on PAAS if all setup is fine.

0
0

I would suggest that your Dockerize your application, then use Testcontainer in a dedicated testing module, where you can spawn your database, RabbitMQ and multiple instances of your application in the setup of your tests. Then you can perform your tests by calling your API, randomly hitting any of your application containers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.