Skip to content

Commit

Permalink
add turbine stream service
Browse files Browse the repository at this point in the history
  • Loading branch information
chidov committed Sep 10, 2018
1 parent 5c2880d commit 3a7e3ec
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 2 deletions.
Empty file.
5 changes: 4 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ services:
- 28000:27017

monitoring:
build: monitoring
build: monitoring

turbine-stream-service:
build: turbine-stream-service
16 changes: 15 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions turbine-stream-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM java:8-jre
MAINTAINER Chi Dov <[email protected]>

ADD ./target/turbine-stream-service.jar /app/
CMD ["java", "-Xmx200m", "-jar", "/app/turbine-stream-service.jar"]

EXPOSE 8989
56 changes: 56 additions & 0 deletions turbine-stream-service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>piggymetrics</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>turbine-stream-service</name>
<description>Turbine Stream Service</description>

<parent>
<groupId>com.piggymetrics</groupId>
<artifactId>piggymetrics</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

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

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

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${project.name}</finalName>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -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);
}
}
9 changes: 9 additions & 0 deletions turbine-stream-service/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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() {
}

}
3 changes: 3 additions & 0 deletions turbine-stream-service/src/test/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eureka:
client:
enabled: false

0 comments on commit 3a7e3ec

Please sign in to comment.