Skip to content

Commit

Permalink
Upgrade to Spring Cloud Finchley #72 (#80)
Browse files Browse the repository at this point in the history
* #72 Upgrade to Spring Cloud Finchley M9

* #72 Upgrade to Spring Boot 2.0.1

* #72 Remove @deprecated API usage

* #72 Upgrade to Spring Cloud Finchley RC2, Spring Boot 2.0.2, Sleuth 2.0.0.RC2, Zipkin Server 2.8.4

* #72 Registering the index ViewController is no more required

* For logging, implement the toString() method of the Pet entity

* #72 Upgrade to Spring Boot Admin 2.0.0

* #72 Add @NoArgsConstructor required for Jackson deserialization

* #72 Upgrade to Spring Boot 2.0.3

* #72 Upgrade to Spring Cloud Finchley RELEASE

* Change Zipkin local host URL

* #72 changes requested by the @mszarlinski code review
  • Loading branch information
arey authored and mszarlinski committed Jul 14, 2018
1 parent 387f824 commit ba03bfe
Show file tree
Hide file tree
Showing 28 changed files with 141 additions and 108 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If everything goes well, you can access the following services at given location
* Config Server - http://localhost:8888
* AngularJS frontend (API Gateway) - http://localhost:8080
* Customers, Vets and Visits Services - random port, check Eureka Dashboard
* Tracing Server (Zipkin) - http://localhost:9411
* Tracing Server (Zipkin) - http://localhost:9411/zipkin/
* Admin Server (Spring Boot Admin) - http://localhost:9090

You can tell Config Server to use your local Git repository by using `local` Spring profile and setting
Expand Down
77 changes: 43 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>

<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>1.5.9</version>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.3</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<packaging>pom</packaging>

<modules>
<module>spring-petclinic-admin-server</module>
<module>spring-petclinic-customers-service</module>
<module>spring-petclinic-vets-service</module>
<module>spring-petclinic-visits-service</module>
<module>spring-petclinic-config-server</module>
<modules>
<module>spring-petclinic-admin-server</module>
<module>spring-petclinic-customers-service</module>
<module>spring-petclinic-vets-service</module>
<module>spring-petclinic-visits-service</module>
<module>spring-petclinic-config-server</module>
<module>spring-petclinic-discovery-server</module>
<module>spring-petclinic-api-gateway</module>
<module>spring-petclinic-monitoring</module>
Expand All @@ -28,32 +29,32 @@

<properties>
<assertj.version>3.9.0</assertj.version>
<spring-cloud.version>Edgware.SR1</spring-cloud.version>
<sleuth.version>1.3.1.RELEASE</sleuth.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
<sleuth.version>2.0.0.RC2</sleuth.version>
<java.version>1.8</java.version>

<docker.image.prefix>mszarlinski</docker.image.prefix>
<docker.image.prefix>mszarlinski</docker.image.prefix>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}</docker.image.dockerfile.dir>
<docker.plugin.version>0.4.13</docker.plugin.version>
<docker.plugin.version>0.4.13</docker.plugin.version>
</properties>

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

<dependency>
<groupId>org.springframework.samples.petclinic.monitoring</groupId>
Expand All @@ -66,8 +67,8 @@
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
</dependencies>
</dependencyManagement>

<profiles>
<profile>
Expand Down Expand Up @@ -167,4 +168,12 @@
</profile>
</profiles>

<repositories>
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>

</project>
6 changes: 3 additions & 3 deletions spring-petclinic-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>1.5.9</version>
<version>2.0.3</version>
</parent>

<properties>
<spring-boot-admin.version>1.5.6</spring-boot-admin.version>
<spring-boot-admin.version>2.0.1</spring-boot-admin.version>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}/../docker</docker.image.dockerfile.dir>
</properties>
Expand All @@ -39,7 +39,7 @@
<!-- Spring Boot Admin -->
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>${spring-boot-admin.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.springframework.samples.petclinic.admin;

import de.codecentric.boot.admin.config.EnableAdminServer;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
Expand All @@ -29,4 +29,5 @@ public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}

}
4 changes: 2 additions & 2 deletions spring-petclinic-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>1.5.9</version>
<version>2.0.3</version>
</parent>

<properties>
Expand Down Expand Up @@ -106,7 +106,7 @@
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<artifactId>webjars-locator-core</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -29,17 +30,17 @@
@Data
public class OwnerDetails {

private final int id;
private int id;

private final String firstName;
private String firstName;

private final String lastName;
private String lastName;

private final String address;
private String address;

private final String city;
private String city;

private final String telephone;
private String telephone;

private final List<PetDetails> pets = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.springframework.samples.petclinic.api.application;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -26,13 +27,13 @@
@Data
public class PetDetails {

private final int id;
private int id;

private final String name;
private String name;

private final String birthDate;
private String birthDate;

private final PetType type;
private PetType type;

private final List<VisitDetails> visits = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
package org.springframework.samples.petclinic.api.application;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @author Maciej Szarlinski
*/
@Data
public class PetType {

private final String name;
private String name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
package org.springframework.samples.petclinic.api.application;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @author Maciej Szarlinski
*/
@Data
public class VisitDetails {

private final int id;
private int id;

private final int petId;
private int petId;

private final String date;
private String date;

private final String description;
private String description;
}

This file was deleted.

2 changes: 1 addition & 1 deletion spring-petclinic-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>1.5.9</version>
<version>2.0.3</version>
</parent>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions spring-petclinic-customers-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>1.5.9</version>
<version>2.0.3</version>
</parent>

<properties>
Expand Down Expand Up @@ -52,7 +52,7 @@
</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.beans.support.MutableSortDefinition;
import org.springframework.beans.support.PropertyComparator;
import org.springframework.core.style.ToStringCreator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.core.style.ToStringCreator;

/**
* Simple business object representing a pet.
Expand Down Expand Up @@ -100,4 +101,17 @@ public Owner getOwner() {
public void setOwner(final Owner owner) {
this.owner = owner;
}

@Override
public String toString() {
return new ToStringCreator(this)
.append("id", this.getId())
.append("name", this.getName())
.append("birthDate", this.getBirthDate())
.append("type", this.getType().getName())
.append("ownerFirstname", this.getOwner().getFirstName())
.append("ownerLastname", this.getOwner().getLastName())
.toString();
}

}
Loading

0 comments on commit ba03bfe

Please sign in to comment.