Skip to content

Commit

Permalink
update spring cloud version
Browse files Browse the repository at this point in the history
  • Loading branch information
bulldog2011 committed Sep 27, 2018
1 parent f6be74a commit 2659a42
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 46 deletions.
13 changes: 7 additions & 6 deletions lab03/eureka-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
<name>eureka-service</name>
<description>Demo project for Spring Boot</description>

<parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

<dependency>
Expand All @@ -37,12 +38,12 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RELEASE</version>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
19 changes: 10 additions & 9 deletions lab03/hello-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,29 @@
<name>hello-client</name>
<description>Demo project for Spring Boot</description>

<parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
Expand All @@ -42,12 +43,12 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RELEASE</version>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@EnableCircuitBreaker
@EnableDiscoveryClient
@SpringBootApplication
public class HelloClientApplication {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.spring2go.helloclient;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -18,16 +17,11 @@ public class HelloResource {
@Autowired
private RestTemplate restTemplate;

@HystrixCommand(fallbackMethod = "fallback", groupKey = "Hello", commandKey = "hello", threadPoolKey = "helloThread")
@GetMapping
public String hello() {
String url = "http://hello-server/rest/hello/server";
return restTemplate.getForObject(url, String.class) + " including client(on port " + port
+ ").";
}

public String fallback(Throwable hystrixCommand) {
return "Fall Back Hello world";
}

}
12 changes: 2 additions & 10 deletions lab03/hello-client/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ eureka:
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8070/eureka/
instance:
hostname: localhost

hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000
instance:
instanceId: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}


18 changes: 12 additions & 6 deletions lab03/hello-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,29 @@
<name>hello-server</name>
<description>Demo project for Spring Boot</description>

<parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
Expand All @@ -37,12 +43,12 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RELEASE</version>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion lab03/hello-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ eureka:
serviceUrl:
defaultZone: http://localhost:8070/eureka/
instance:
hostname: localhost
instanceId: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
15 changes: 8 additions & 7 deletions lab03/zuul-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@
<name>zuul-service</name>
<description>Demo project for Spring Boot</description>

<parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>

<dependency>
Expand All @@ -41,12 +42,12 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RELEASE</version>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit 2659a42

Please sign in to comment.