diff --git a/config/src/main/resources/shared/turbine-stream-service.yml b/config/src/main/resources/shared/turbine-stream-service.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 1a6797dcfd..155a7b590a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -56,4 +56,7 @@ services: - 28000:27017 monitoring: - build: monitoring \ No newline at end of file + build: monitoring + + turbine-stream-service: + build: turbine-stream-service \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 034cbf310f..1b67a30a71 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -163,7 +163,21 @@ services: condition: service_healthy ports: - 9000:8080 - - 8989:8989 + logging: + options: + max-size: "10m" + max-file: "10" + + turbine-stream-service: + environment: + CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD + image: sqshq/piggymetrics-turbine-stream-service + restart: always + depends_on: + config: + condition: service_healthy + ports: + - 8989:8989 logging: options: max-size: "10m" diff --git a/turbine-stream-service/Dockerfile b/turbine-stream-service/Dockerfile new file mode 100644 index 0000000000..b37937d58f --- /dev/null +++ b/turbine-stream-service/Dockerfile @@ -0,0 +1,7 @@ +FROM java:8-jre +MAINTAINER Chi Dov + +ADD ./target/turbine-stream-service.jar /app/ +CMD ["java", "-Xmx200m", "-jar", "/app/turbine-stream-service.jar"] + +EXPOSE 8989 \ No newline at end of file diff --git a/turbine-stream-service/pom.xml b/turbine-stream-service/pom.xml new file mode 100644 index 0000000000..e51e977d2e --- /dev/null +++ b/turbine-stream-service/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + piggymetrics + 0.0.1-SNAPSHOT + jar + + turbine-stream-service + Turbine Stream Service + + + com.piggymetrics + piggymetrics + 1.0-SNAPSHOT + + + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.cloud + spring-cloud-starter-netflix-turbine-stream + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${project.name} + + + + + + diff --git a/turbine-stream-service/src/main/java/com/piggymetrics/turbine/TurbineStreamServiceApplication.java b/turbine-stream-service/src/main/java/com/piggymetrics/turbine/TurbineStreamServiceApplication.java new file mode 100644 index 0000000000..d83868f4b6 --- /dev/null +++ b/turbine-stream-service/src/main/java/com/piggymetrics/turbine/TurbineStreamServiceApplication.java @@ -0,0 +1,16 @@ +package com.piggymetrics.turbine; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.netflix.turbine.stream.EnableTurbineStream; + +@SpringBootApplication +@EnableTurbineStream +@EnableDiscoveryClient +public class TurbineStreamServiceApplication { + + public static void main(String[] args) { + SpringApplication.run(TurbineStreamServiceApplication.class, args); + } +} diff --git a/turbine-stream-service/src/main/resources/bootstrap.yml b/turbine-stream-service/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..3b7faa6245 --- /dev/null +++ b/turbine-stream-service/src/main/resources/bootstrap.yml @@ -0,0 +1,9 @@ +spring: + application: + name: turbine-stream-service + cloud: + config: + uri: http://config:8888 + fail-fast: true + password: ${CONFIG_SERVICE_PASSWORD} + username: user \ No newline at end of file diff --git a/turbine-stream-service/src/test/java/com/piggymetrics/turbine/TurbineStreamServiceApplicationTests.java b/turbine-stream-service/src/test/java/com/piggymetrics/turbine/TurbineStreamServiceApplicationTests.java new file mode 100644 index 0000000000..78ff7e8bbf --- /dev/null +++ b/turbine-stream-service/src/test/java/com/piggymetrics/turbine/TurbineStreamServiceApplicationTests.java @@ -0,0 +1,16 @@ +package com.piggymetrics.turbine; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class TurbineStreamServiceApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/turbine-stream-service/src/test/resources/bootstrap.yml b/turbine-stream-service/src/test/resources/bootstrap.yml new file mode 100644 index 0000000000..5fde57fd8a --- /dev/null +++ b/turbine-stream-service/src/test/resources/bootstrap.yml @@ -0,0 +1,3 @@ +eureka: + client: + enabled: false \ No newline at end of file