Eureka Server/Client
This commit is contained in:
@@ -2,6 +2,7 @@ package com.javadevjournal.eurekaclient1;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.javadevjournal.eurekaclient2.model;
|
||||
package com.javadevjournal.eurekaclient1.model;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.javadevjournal.eurekaclient2;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
public class Eurekaclient2Controller {
|
||||
private List<Product> productList = new ArrayList<>();
|
||||
private static List<Product> productList = new ArrayList<>();
|
||||
static{
|
||||
productList = new ArrayList<>();
|
||||
Product p1 = new Product(UUID.randomUUID(), "Guitar" , 99.99, "Music");
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.javadevjournal.eurekaserver;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||
|
||||
@EnableEurekaServer
|
||||
@SpringBootApplication
|
||||
public class EurekaserverApplication {
|
||||
|
||||
Reference in New Issue
Block a user