Re-organize docker files for Zipkin server

Still not quite working:

$ docker-compose -f docker-compose.yml -f docker-compose.zipkin.yml up

everything starts up fine (once the database is initialized), but
the zipkin server is not listening to rabbit (and there are errors
in the logs).
This commit is contained in:
Dave Syer
2015-12-11 16:33:25 +00:00
parent ce4a7409fa
commit b1068e2050
7 changed files with 81 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
FROM frolvlad/alpine-oraclejdk8
VOLUME /tmp
ADD spring-cloud-sleuth-zipkin-stream-1.0.0.BUILD-SNAPSHOT.jar app.jar
ADD @project.artifactId@-@project.version@-exec.jar app.jar
RUN sh -c 'touch /app.jar'
EXPOSE 9411
CMD ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

View File

@@ -5,10 +5,10 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
@SpringBootApplication
@EnableZipkinStreamServer
public class ZipkinQueryServerApplication {
public class ZipkinStreamServerApplication {
public static void main(String[] args) throws Exception {
new SpringApplicationBuilder(ZipkinQueryServerApplication.class)
new SpringApplicationBuilder(ZipkinStreamServerApplication.class)
.properties("spring.config.name=zipkin-server").run(args);
}

View File

@@ -2,13 +2,15 @@ server:
port: 9411
spring:
rabbitmq:
host: ${RABBIT_HOST:localhost}
datasource:
schema: classpath:/mysql.sql
url: jdbc:mysql://${MYSQL_HOST:localhost}/test
username: root
password: root
# Switch this on to create the schema on startup:
initialize: false
initialize: true
continueOnError: true
sleuth:
enabled: false

View File

@@ -7,24 +7,23 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.cloud.sleuth.zipkin.stream.ZipkinQueryServerApplication;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import io.zipkin.SpanStore;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ZipkinQueryServerApplication.class)
@SpringApplicationConfiguration(classes = ZipkinStreamServerApplication.class)
@IntegrationTest({ "server.port=0", "spring.datasource.initialize=true" })
@ActiveProfiles("test")
public class ZipkinServerApplicationTests {
@Autowired
private JdbcTemplate jdbcTemplate;
private SpanStore store;
@Test
public void contextLoads() {
int count = this.jdbcTemplate.queryForObject("SELECT COUNT(*) FROM zipkin_spans",
Integer.class);
int count = this.store.getServiceNames().size();
assertEquals(0, count);
}