Skip to content

Commit 55fd720

Browse files
committed
initial commit
0 parents  commit 55fd720

File tree

33 files changed

+686
-0
lines changed

33 files changed

+686
-0
lines changed

README.md

Whitespace-only changes.

config-service/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:8-jdk-alpine
2+
VOLUME /tmp
3+
ARG JAR_FILE
4+
ADD ${JAR_FILE} app.jar
5+
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

config-service/README.md

Whitespace-only changes.

config-service/pom.xml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>spring-cloud-template</artifactId>
7+
<groupId>de.marcusjanke.examples</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>config-service</artifactId>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.springframework.cloud</groupId>
17+
<artifactId>spring-cloud-starter-config</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.springframework.cloud</groupId>
21+
<artifactId>spring-cloud-config-server</artifactId>
22+
</dependency>
23+
</dependencies>
24+
<repositories>
25+
<repository>
26+
<id>spring-milestones</id>
27+
<name>Spring Milestones</name>
28+
<url>https://repo.spring.io/libs-milestone</url>
29+
<snapshots>
30+
<enabled>false</enabled>
31+
</snapshots>
32+
</repository>
33+
</repositories>
34+
<dependencyManagement>
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.springframework.cloud</groupId>
38+
<artifactId>spring-cloud-config</artifactId>
39+
<version>1.4.2.RELEASE</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.springframework.boot</groupId>
50+
<artifactId>spring-boot-maven-plugin</artifactId>
51+
<configuration>
52+
<!-- Only because we're not inheriting spring-boot-starter-parent -->
53+
<mainClass>de.marcusjanke.examples.springcloud.configservice.Application</mainClass>
54+
<layout>ZIP</layout>
55+
</configuration>
56+
<executions>
57+
<execution>
58+
<goals>
59+
<goal>repackage</goal>
60+
</goals>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
<plugin>
65+
<groupId>com.spotify</groupId>
66+
<artifactId>dockerfile-maven-plugin</artifactId>
67+
<version>1.3.6</version>
68+
<executions>
69+
<execution>
70+
<id>default</id>
71+
<goals>
72+
<goal>build</goal>
73+
</goals>
74+
</execution>
75+
</executions>
76+
<configuration>
77+
<repository>${docker.image.prefix}/${project.artifactId}</repository>
78+
<buildArgs>
79+
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
80+
</buildArgs>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package de.marcusjanke.examples.springcloud.configservice;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.config.server.EnableConfigServer;
6+
7+
@SpringBootApplication
8+
@EnableConfigServer
9+
public class Application {
10+
11+
public static void main(String[] args) {
12+
SpringApplication.run(Application.class, args);
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server:
2+
port: 8888
3+
spring:
4+
profiles:
5+
active: native
6+
cloud:
7+
config:
8+
server:
9+
native:
10+
searchLocations: classpath:configs/cloudservice/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
spring:
2+
application:
3+
name: configservice
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
service.hello: Dude

config-service/src/main/resources/configs/newsservice/newsservice.yml

Whitespace-only changes.

eureka-service/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:8-jdk-alpine
2+
VOLUME /tmp
3+
ARG JAR_FILE
4+
ADD ${JAR_FILE} app.jar
5+
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

eureka-service/pom.xml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>spring-cloud-template</artifactId>
7+
<groupId>de.marcusjanke.examples</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<packaging>jar</packaging>
12+
13+
<artifactId>eureka-service</artifactId>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.springframework.cloud</groupId>
18+
<artifactId>spring-cloud-starter-eureka-server</artifactId>
19+
<version>1.4.2.RELEASE</version>
20+
</dependency>
21+
</dependencies>
22+
<dependencyManagement>
23+
<dependencies>
24+
<dependency>
25+
<groupId>org.springframework.cloud</groupId>
26+
<artifactId>spring-cloud-dependencies</artifactId>
27+
<version>Edgware.SR3</version>
28+
<type>pom</type>
29+
<scope>import</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-dependencies</artifactId>
34+
<version>1.5.7.RELEASE</version>
35+
<type>pom</type>
36+
<scope>import</scope>
37+
</dependency>
38+
</dependencies>
39+
</dependencyManagement>
40+
<repositories>
41+
<repository>
42+
<id>spring-milestones</id>
43+
<name>Spring Milestones</name>
44+
<url>https://repo.spring.io/libs-milestone</url>
45+
<snapshots>
46+
<enabled>false</enabled>
47+
</snapshots>
48+
</repository>
49+
</repositories>
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.springframework.boot</groupId>
54+
<artifactId>spring-boot-maven-plugin</artifactId>
55+
<configuration>
56+
<!-- Only because we're not inheriting spring-boot-starter-parent -->
57+
<mainClass>de.marcusjanke.examples.springcloud.eurekaservice.Application</mainClass>
58+
<layout>ZIP</layout>
59+
</configuration>
60+
<executions>
61+
<execution>
62+
<goals>
63+
<goal>repackage</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
<plugin>
69+
<groupId>com.spotify</groupId>
70+
<artifactId>dockerfile-maven-plugin</artifactId>
71+
<version>1.3.6</version>
72+
<executions>
73+
<execution>
74+
<id>default</id>
75+
<goals>
76+
<goal>build</goal>
77+
</goals>
78+
</execution>
79+
</executions>
80+
<configuration>
81+
<repository>${docker.image.prefix}/${project.artifactId}</repository>
82+
<buildArgs>
83+
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
84+
</buildArgs>
85+
</configuration>
86+
</plugin>
87+
</plugins>
88+
</build>
89+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package de.marcusjanke.examples.springcloud.eurekaservice;
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 Application {
10+
11+
public static void main(String[] args) {
12+
SpringApplication.run(Application.class, args);
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
server:
2+
port: 8761
3+
eureka:
4+
client:
5+
registerWithEureka: false
6+
fetchRegistry: false
7+
server:
8+
waitTimeInMsWhenSyncEmpty: 5

greeting-service/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:8-jdk-alpine
2+
VOLUME /tmp
3+
ARG JAR_FILE
4+
ADD ${JAR_FILE} app.jar
5+
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

greeting-service/README.md

Whitespace-only changes.

greeting-service/pom.xml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>spring-cloud-template</artifactId>
7+
<groupId>de.marcusjanke.examples</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>greeting-service</artifactId>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.springframework.boot</groupId>
17+
<artifactId>spring-boot-starter</artifactId>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-web</artifactId>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.springframework.cloud</groupId>
25+
<artifactId>spring-cloud-config-client</artifactId>
26+
<version>1.4.2.RELEASE</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.springframework.cloud</groupId>
30+
<artifactId>spring-cloud-starter-eureka</artifactId>
31+
<version>1.4.2.RELEASE</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.springframework.cloud</groupId>
35+
<artifactId>spring-cloud-starter-hystrix</artifactId>
36+
<version>1.4.2.RELEASE</version>
37+
</dependency>
38+
</dependencies>
39+
40+
<dependencyManagement>
41+
<dependencies>
42+
<dependency>
43+
<!-- Import dependency management from Spring Boot -->
44+
<groupId>org.springframework.boot</groupId>
45+
<artifactId>spring-boot-dependencies</artifactId>
46+
<version>1.5.7.RELEASE</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
</dependencies>
51+
</dependencyManagement>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
<configuration>
59+
<!-- Only because we're not inheriting spring-boot-starter-parent -->
60+
<mainClass>de.marcusjanke.examples.springcloud.greetingservice.Application</mainClass>
61+
<layout>ZIP</layout>
62+
</configuration>
63+
<executions>
64+
<execution>
65+
<goals>
66+
<goal>repackage</goal>
67+
</goals>
68+
</execution>
69+
</executions>
70+
</plugin>
71+
<plugin>
72+
<groupId>com.spotify</groupId>
73+
<artifactId>dockerfile-maven-plugin</artifactId>
74+
<version>1.3.6</version>
75+
<executions>
76+
<execution>
77+
<id>default</id>
78+
<goals>
79+
<goal>build</goal>
80+
</goals>
81+
</execution>
82+
</executions>
83+
<configuration>
84+
<repository>${docker.image.prefix}/${project.artifactId}</repository>
85+
<buildArgs>
86+
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
87+
</buildArgs>
88+
</configuration>
89+
</plugin>
90+
</plugins>
91+
</build>
92+
93+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package de.marcusjanke.examples.springcloud.greetingservice;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
6+
7+
@SpringBootApplication
8+
@EnableCircuitBreaker
9+
public class Application {
10+
11+
public static void main(String[] args) {
12+
SpringApplication.run(Application.class, args);
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package de.marcusjanke.examples.springcloud.greetingservice.config;
2+
3+
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
4+
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.client.RestTemplate;
7+
8+
@Configuration
9+
public class AppConfig {
10+
11+
@LoadBalanced
12+
@Bean
13+
public RestTemplate getRestTemplate() {
14+
//create Ribbon-enabled RestTemplate
15+
return new RestTemplate();
16+
}
17+
}

0 commit comments

Comments
 (0)