I have multiple Spring Cloud microservices. I want the automatic replication of microservices to be done when microservice cannot manage to do its work. I tried to find any solutions but I found only this: here. This solution cannot be applied to my problem as it describes only the case when we have a certain number of microservices.
I will be very grateful if you give me some examples to help me with this problem.
UPDATE: I've several microservices
Eureka:
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args){
SpringApplication.run(EurekaApplication.class, args);
}
}
GatewayApplication:
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
FirstSybsystemApplication:
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
public class FirstSubsystemApplication implements CommandLineRunner{
public static void main(String[] args) {
SpringApplication.run(FirstSubsystemApplication.class);
}
@Override
public void run(String... args) throws Exception {
}
}
I want to make a high load on FirstSubsystemApplication and to launch its copy automatically.