0

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.

Dmitry
  • 73
  • 2
  • 11
  • Where do you run your microservices? Do you use something like Cloud Foundry, or another PaaS? Are we talking about scaling here? – C-Otto Mar 03 '17 at 23:41
  • I use Eureka, Zuul, Feign. Each microservice work is on tomcat (in future it will work in Docker). I'm novice in microservices :-) – Dmitry Mar 03 '17 at 23:52
  • 1
    Spring Cloud Netflix can load balance between instances, but you need a platform like Cloud Foundry, Kubernetes, AWS, GCE or Azure to scale (replicate) instances. Your question is very unclear what you are asking. – spencergibb Mar 04 '17 at 00:41
  • I'm asking for the replication of microservices, not the replication of server nodes (if you mean server nodes by mentioning 'instances', as I understood). I don't think that I need such a platform. Actually, I'm confused by such a variety of technologies. Is there any manual about it? I want to understand what I should use. – Dmitry Mar 04 '17 at 09:56
  • I added my simple code for example of what I use. – Dmitry Mar 04 '17 at 10:08
  • i don't think "replicate" is the right word to use. There are various platforms out there that let you easily run multiple instances of each microservice. You can optionally use something like spring cloud Netflix to load balance between these instances if you want. Sounds like you need to spend some time researching various platforms for running your microservices. – Ryan Baxter Mar 04 '17 at 16:06

0 Answers0