File tree Expand file tree Collapse file tree 7 files changed +158
-0
lines changed
spring-cloud/spring-cloud-eureka-self-preservation
spring-cloud-eureka-client
java/com/baeldung/spring/cloud/eureka/client
spring-cloud-eureka-server
java/com/baeldung/spring/cloud/eureka/server Expand file tree Collapse file tree 7 files changed +158
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+ <modelVersion >4.0.0</modelVersion >
5
+ <groupId >com.baeldung.spring.cloud.eureka</groupId >
6
+ <artifactId >spring-cloud-eureka-self-preservation</artifactId >
7
+ <name >spring-cloud-eureka-self-preservation</name >
8
+ <description >Spring Cloud Eureka Server Self Preservation</description >
9
+ <packaging >pom</packaging >
10
+
11
+ <parent >
12
+ <groupId >com.baeldung.spring.cloud</groupId >
13
+ <artifactId >spring-cloud</artifactId >
14
+ <version >1.0.0-SNAPSHOT</version >
15
+ <relativePath >..</relativePath >
16
+ </parent >
17
+
18
+ <modules >
19
+ <module >spring-cloud-eureka-server</module >
20
+ <module >spring-cloud-eureka-client</module >
21
+ </modules >
22
+
23
+ <dependencies >
24
+ <dependency >
25
+ <groupId >org.springframework.boot</groupId >
26
+ <artifactId >spring-boot-starter-test</artifactId >
27
+ <version >${spring-boot.version} </version >
28
+ <scope >test</scope >
29
+ </dependency >
30
+ </dependencies >
31
+
32
+ <properties >
33
+ <spring-boot .version>2.1.3.RELEASE</spring-boot .version>
34
+ <spring-cloud-dependencies .version>Greenwich.SR3</spring-cloud-dependencies .version>
35
+ </properties >
36
+
37
+ </project >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+ <modelVersion >4.0.0</modelVersion >
5
+ <artifactId >spring-cloud-eureka-client</artifactId >
6
+ <name >spring-cloud-eureka-client</name >
7
+ <description >Spring Cloud Eureka Sample Client</description >
8
+ <packaging >jar</packaging >
9
+
10
+ <parent >
11
+ <groupId >com.baeldung.spring.cloud.eureka</groupId >
12
+ <artifactId >spring-cloud-eureka-self-preservation</artifactId >
13
+ <version >1.0.0-SNAPSHOT</version >
14
+ <relativePath >..</relativePath >
15
+ </parent >
16
+
17
+ <dependencies >
18
+ <dependency >
19
+ <groupId >org.springframework.cloud</groupId >
20
+ <artifactId >spring-cloud-starter-netflix-eureka-client</artifactId >
21
+ </dependency >
22
+ <dependency >
23
+ <groupId >org.springframework.boot</groupId >
24
+ <artifactId >spring-boot-starter-web</artifactId >
25
+ </dependency >
26
+ </dependencies >
27
+
28
+ <dependencyManagement >
29
+ <dependencies >
30
+ <dependency >
31
+ <groupId >org.springframework.cloud</groupId >
32
+ <artifactId >spring-cloud-starter-parent</artifactId >
33
+ <version >${spring-cloud-dependencies.version} </version >
34
+ <type >pom</type >
35
+ <scope >import</scope >
36
+ </dependency >
37
+ </dependencies >
38
+ </dependencyManagement >
39
+
40
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .baeldung .spring .cloud .eureka .client ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+ import org .springframework .cloud .netflix .eureka .EnableEurekaClient ;
6
+
7
+ @ SpringBootApplication
8
+ @ EnableEurekaClient
9
+ public class EurekaClientApplication {
10
+
11
+ public static void main (String [] args ) {
12
+ SpringApplication .run (EurekaClientApplication .class , args );
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ spring.application.name =Eurekaclient
2
+ server.port =${PORT:0}
3
+ eureka.client.serviceUrl.defaultZone =http://localhost:8761/eureka
4
+ eureka.instance.preferIpAddress = true
5
+ eureka.client.should-unregister-on-shutdown =false
6
+ eureka.instance.lease-renewal-interval-in-seconds =30
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+ <modelVersion >4.0.0</modelVersion >
5
+ <artifactId >spring-cloud-eureka-server</artifactId >
6
+ <name >spring-cloud-eureka-server</name >
7
+ <description >Spring Cloud Eureka Server</description >
8
+ <packaging >jar</packaging >
9
+
10
+ <parent >
11
+ <groupId >com.baeldung.spring.cloud.eureka</groupId >
12
+ <artifactId >spring-cloud-eureka-self-preservation</artifactId >
13
+ <version >1.0.0-SNAPSHOT</version >
14
+ <relativePath >..</relativePath >
15
+ </parent >
16
+
17
+ <dependencies >
18
+ <dependency >
19
+ <groupId >org.springframework.cloud</groupId >
20
+ <artifactId >spring-cloud-starter-netflix-eureka-server</artifactId >
21
+ </dependency >
22
+ </dependencies >
23
+
24
+ <dependencyManagement >
25
+ <dependencies >
26
+ <dependency >
27
+ <groupId >org.springframework.cloud</groupId >
28
+ <artifactId >spring-cloud-starter-parent</artifactId >
29
+ <version >${spring-cloud-dependencies.version} </version >
30
+ <type >pom</type >
31
+ <scope >import</scope >
32
+ </dependency >
33
+ </dependencies >
34
+ </dependencyManagement >
35
+
36
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .baeldung .spring .cloud .eureka .server ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+ import org .springframework .cloud .netflix .eureka .server .EnableEurekaServer ;
6
+
7
+ @ SpringBootApplication
8
+ @ EnableEurekaServer
9
+ public class EurekaServerApplication {
10
+ public static void main (String [] args ) {
11
+ SpringApplication .run (EurekaServerApplication .class , args );
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ spring.application.name =Eurekaserver
2
+ eureka.client.registerWithEureka =false
3
+ eureka.client.fetchRegistry =false
4
+ server.port =8761
5
+ eureka.instance.hostname =localhost
6
+ eureka.server.expected-client-renewal-interval-seconds =30
7
+ eureka.instance.lease-expiration-duration-in-seconds =90
8
+ eureka.server.eviction-interval-timer-in-ms =60000
9
+ eureka.server.renewal-percent-threshold =0.85
10
+ eureka.server.renewal-threshold-update-interval-ms =900000
11
+ eureka.server.enable-self-preservation =true
You can’t perform that action at this time.
0 commit comments