Skip to content

Commit

Permalink
Moves spring cli app to normal boot app and migrates from zuul to spr…
Browse files Browse the repository at this point in the history
…ing cloud gateway.
  • Loading branch information
spencergibb committed Aug 3, 2018
1 parent 26e6e87 commit 348c8be
Show file tree
Hide file tree
Showing 55 changed files with 103 additions and 92 deletions.
10 changes: 0 additions & 10 deletions customers-stores-ui/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions customers-stores-ui/app.groovy

This file was deleted.

29 changes: 0 additions & 29 deletions customers-stores-ui/application.yml

This file was deleted.

6 changes: 0 additions & 6 deletions customers-stores-ui/docker-compose.yml

This file was deleted.

6 changes: 0 additions & 6 deletions customers-stores-ui/docker/Dockerfile

This file was deleted.

27 changes: 27 additions & 0 deletions customers-stores-ui/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.samples.rest</groupId>
<artifactId>rest-microservices</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
</parent>

<artifactId>rest-microservices-ui</artifactId>

<properties>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
</dependencies>

</project>
16 changes: 16 additions & 0 deletions customers-stores-ui/src/main/java/example/ui/UiApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package example.ui;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.stereotype.Controller;

@EnableDiscoveryClient
@SpringBootApplication
@Controller
public class UiApp {

public static void main(String[] args) {
new SpringApplication(UiApp.class).run(args);
}
}
42 changes: 42 additions & 0 deletions customers-stores-ui/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
server:
port: 9900
logging:
level:
com.netflix.discovery: 'OFF'
com.netflix.zuul: 'OFF'
eureka:
instance:
leaseRenewalIntervalInSeconds: 10
client:
registryFetchIntervalSeconds: 5

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000
ribbon:
ServerListRefreshInterval: 5000
ConnectTimeout: 3000
ReadTimeout: 60000

spring:
cloud:
gateway:
routes:
- id: stores
uri: lb://stores
predicates:
- Path=/stores/**
- id: customers
uri: lb://customers
predicates:
- Path=/customers/**
- id: root
uri: no://op
predicates:
- Path=/
filters:
- RedirectTo=302, /index.html#/customers

management:
endpoints:
web:
exposure:
include: '*'
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ spring:
cloud:
config:
uri: ${vcap.services.${PREFIX:}configserver.credentials.uri:${CONFIG_SERVER_URI:http://localhost:8888}}
failFast: true
# failFast: true

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 9 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
<modules>
<module>rest-microservices-store</module>
<module>rest-microservices-customers</module>
<module>customers-stores-ui</module>
</modules>

<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
<spring-cloud.version>Finchley.BUILD-SNAPSHOT</spring-cloud.version>
<docker.image.prefix>springcloud</docker.image.prefix>
</properties>

Expand All @@ -38,19 +39,11 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand All @@ -71,19 +64,20 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-cloudfoundry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<artifactId>spring-cloud-netflix-hystrix-stream</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
12 changes: 4 additions & 8 deletions rest-microservices-customers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,37 @@
</properties>

<dependencies>

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

<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>


<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-rsa</artifactId>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
</dependencies>

</project>
9 changes: 4 additions & 5 deletions rest-microservices-store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,31 @@
</properties>

<dependencies>

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

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>

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

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

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>

</dependencies>

Expand Down

0 comments on commit 348c8be

Please sign in to comment.