Skip to content

Commit 23d4760

Browse files
ShyamVedapivovarit
authored andcommitted
Zuul and Eureka Integration for discovering routes (eugenp#3363)
1 parent db04ce5 commit 23d4760

19 files changed

Lines changed: 639 additions & 1 deletion

File tree

‎spring-cloud/pom.xml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
<module>spring-cloud-connectors-heroku</module>
2121
<module>spring-cloud-aws</module>
2222
<module>spring-cloud-consul</module>
23-
</modules>
23+
<module>spring-cloud-zuul-eureka-integration</module>
24+
</modules>
2425
<packaging>pom</packaging>
2526

2627
<name>spring-cloud</name>
@@ -45,6 +46,7 @@
4546
<spring-boot-starter-web.version>1.4.2.RELEASE</spring-boot-starter-web.version>
4647
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
4748
<spring-boot-maven-plugin.version>1.4.2.RELEASE</spring-boot-maven-plugin.version>
49+
<spring-cloud-starter-zuul.version>1.2.3.RELEASE</spring-cloud-starter-zuul.version>
4850
</properties>
4951

5052
<build>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>eureka-client</artifactId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>Spring Cloud Eureka Client</name>
12+
<description>Spring Cloud Eureka Sample Client</description>
13+
14+
<parent>
15+
<groupId>com.baeldung.spring.cloud</groupId>
16+
<artifactId>spring-cloud-zuul-eureka-integration</artifactId>
17+
<version>1.0.0-SNAPSHOT</version>
18+
</parent>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-starter-eureka</artifactId>
24+
<version>${spring-cloud-starter-eureka.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter-web</artifactId>
29+
<version>${spring-boot-starter-web.version}</version>
30+
</dependency>
31+
</dependencies>
32+
33+
<dependencyManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.springframework.cloud</groupId>
37+
<artifactId>spring-cloud-starter-parent</artifactId>
38+
<version>${spring-cloud-dependencies.version}</version>
39+
<type>pom</type>
40+
<scope>import</scope>
41+
</dependency>
42+
</dependencies>
43+
</dependencyManagement>
44+
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-compiler-plugin</artifactId>
50+
<version>3.7.0</version>
51+
<configuration>
52+
<source>1.8</source>
53+
<target>1.8</target>
54+
</configuration>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-maven-plugin</artifactId>
59+
</plugin>
60+
</plugins>
61+
</build>
62+
63+
<properties>
64+
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
65+
<spring-cloud-starter-eureka.version>1.2.3.RELEASE</spring-cloud-starter-eureka.version>
66+
<spring-boot-starter-web.version>1.4.2.RELEASE</spring-boot-starter-web.version>
67+
</properties>
68+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
spring:
2+
application:
3+
name: spring-cloud-eureka-client
4+
5+
server:
6+
port: 0
7+
8+
eureka:
9+
client:
10+
serviceUrl:
11+
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka}
12+
instance:
13+
preferIpAddress: true
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>eureka-server</artifactId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>Spring Cloud Eureka Server</name>
12+
<description>Spring Cloud Eureka Server Demo</description>
13+
14+
<parent>
15+
<groupId>com.baeldung.spring.cloud</groupId>
16+
<artifactId>spring-cloud-zuul-eureka-integration</artifactId>
17+
<version>1.0.0-SNAPSHOT</version>
18+
</parent>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-starter-eureka-server</artifactId>
24+
<version>${spring-cloud-starter-eureka.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>commons-configuration</groupId>
28+
<artifactId>commons-configuration</artifactId>
29+
<version>${commons-config.version}</version>
30+
</dependency>
31+
32+
</dependencies>
33+
34+
<dependencyManagement>
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.springframework.cloud</groupId>
38+
<artifactId>spring-cloud-starter-parent</artifactId>
39+
<version>${spring-cloud-dependencies.version}</version>
40+
<type>pom</type>
41+
<scope>import</scope>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
46+
<build>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.7.0</version>
52+
<configuration>
53+
<source>1.8</source>
54+
<target>1.8</target>
55+
</configuration>
56+
</plugin>
57+
<plugin>
58+
<groupId>org.springframework.boot</groupId>
59+
<artifactId>spring-boot-maven-plugin</artifactId>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
64+
<properties>
65+
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
66+
<spring-cloud-starter-eureka.version>1.2.3.RELEASE</spring-cloud-starter-eureka.version>
67+
</properties>
68+
</project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
server:
2+
port: 8761
3+
4+
eureka:
5+
client:
6+
registerWithEureka: false
7+
fetchRegistry: false
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.baeldung.spring.cloud</groupId>
8+
<artifactId>spring-cloud-zuul-eureka-integration</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<packaging>pom</packaging>
12+
13+
<name>Spring Cloud Zuul and Eureka Integration</name>
14+
<description>Spring Cloud Zuul and Eureka Integration</description>
15+
16+
<parent>
17+
<groupId>com.baeldung.spring.cloud</groupId>
18+
<artifactId>spring-cloud</artifactId>
19+
<version>1.0.0-SNAPSHOT</version>
20+
<relativePath>..</relativePath>
21+
</parent>
22+
23+
<properties>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
26+
<spring-boot-maven-plugin.version>1.4.2.RELEASE</spring-boot-maven-plugin.version>
27+
<commons-config.version>1.10</commons-config.version>
28+
</properties>
29+
30+
<build>
31+
<pluginManagement>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-compiler-plugin</artifactId>
36+
<version>${maven-compiler-plugin.version}</version>
37+
<configuration>
38+
<source>1.8</source>
39+
<target>1.8</target>
40+
</configuration>
41+
</plugin>
42+
<plugin>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-maven-plugin</artifactId>
45+
<version>${spring-boot-maven-plugin.version}</version>
46+
</plugin>
47+
</plugins>
48+
</pluginManagement>
49+
</build>
50+
<modules>
51+
<module>zuul-server</module>
52+
<module>eureka-server</module>
53+
<module>eureka-client</module>
54+
</modules>
55+
</project>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>com.baeldung.spring.cloud</groupId>
6+
<artifactId>spring-cloud-zuul-eureka-integration</artifactId>
7+
<version>1.0.0-SNAPSHOT</version>
8+
</parent>
9+
<artifactId>zuul-server</artifactId>
10+
<dependencies>
11+
<dependency>
12+
<groupId>org.springframework.boot</groupId>
13+
<artifactId>spring-boot-starter-web</artifactId>
14+
</dependency>
15+
<dependency>
16+
<groupId>org.springframework.cloud</groupId>
17+
<artifactId>spring-cloud-starter-zuul</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.springframework.cloud</groupId>
21+
<artifactId>spring-cloud-starter-eureka</artifactId>
22+
</dependency>
23+
<dependency>
24+
<groupId>commons-configuration</groupId>
25+
<artifactId>commons-configuration</artifactId>
26+
<version>${commons-config.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-security</artifactId>
31+
</dependency>
32+
</dependencies>
33+
<dependencyManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.springframework.cloud</groupId>
37+
<artifactId>spring-cloud-starter-parent</artifactId>
38+
<version>${spring-cloud-dependencies.version}</version>
39+
<type>pom</type>
40+
<scope>import</scope>
41+
</dependency>
42+
</dependencies>
43+
</dependencyManagement>
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-compiler-plugin</artifactId>
49+
<version>3.7.0</version>
50+
<configuration>
51+
<source>1.8</source>
52+
<target>1.8</target>
53+
</configuration>
54+
</plugin>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
</project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server.port=8762
2+
spring.application.name=zuul-server
3+
eureka.instance.preferIpAddress=true
4+
eureka.client.registerWithEureka=true
5+
eureka.client.fetchRegistry=true
6+
eureka.serviceurl.defaultzone=http://localhost:8761/eureka/
7+
management.security.enabled=false
8+
security.basic.enabled=false
9+
hystrix.command.default.execution.timeout.enabled=false
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>eureka-client</artifactId>
8+
<version>1.0.0-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>Spring Cloud Eureka Client</name>
12+
<description>Spring Cloud Eureka Sample Client</description>
13+
14+
<parent>
15+
<groupId>com.baeldung.spring.cloud</groupId>
16+
<artifactId>spring-cloud-zuul-eureka-integration</artifactId>
17+
<version>1.0.0-SNAPSHOT</version>
18+
</parent>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-starter-eureka</artifactId>
24+
<version>${spring-cloud-starter-eureka.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter-web</artifactId>
29+
<version>${spring-boot-starter-web.version}</version>
30+
</dependency>
31+
</dependencies>
32+
33+
<dependencyManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>org.springframework.cloud</groupId>
37+
<artifactId>spring-cloud-starter-parent</artifactId>
38+
<version>${spring-cloud-dependencies.version}</version>
39+
<type>pom</type>
40+
<scope>import</scope>
41+
</dependency>
42+
</dependencies>
43+
</dependencyManagement>
44+
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-compiler-plugin</artifactId>
50+
<version>3.7.0</version>
51+
<configuration>
52+
<source>1.8</source>
53+
<target>1.8</target>
54+
</configuration>
55+
</plugin>
56+
<plugin>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-maven-plugin</artifactId>
59+
</plugin>
60+
</plugins>
61+
</build>
62+
63+
<properties>
64+
<spring-cloud-dependencies.version>Brixton.SR7</spring-cloud-dependencies.version>
65+
<spring-cloud-starter-eureka.version>1.2.3.RELEASE</spring-cloud-starter-eureka.version>
66+
<spring-boot-starter-web.version>1.4.2.RELEASE</spring-boot-starter-web.version>
67+
</properties>
68+
</project>

0 commit comments

Comments
 (0)