I want to know about the possible options for auto-scaling my web app architecture. What I have in architect is web-app (Tomcat), middleware (RabbitMQ), database(MongoDB), worker(standalone Java app). Right now I am attempting scaling based on the CPU Utilization. I can auto scale my web-app and worker as expected, but I am facing problems scaling rabbitmq because I do not know how to pass load to the newly instantinated rabbtimq server.
For instance, I have 2 Tomcat servers running. Whenever the CPU utilization of my RabbitMQ instance is greater than 80%, AWS will add a new RabbitMQ server. But my Tomcat server(s) do not know that a new instance of RabbitMQ is added, so they keep referring to the original RabbitMQ server only and not the newly created one.
What could I do? Should I auto-scale whole architecture when Rabbit CPU utilization goes up? Or should I give up the idea of auto-scaling RabbitMQ entirely and create the required instances at the initial stage of deployment? Are there other options?