Skip to content

Commit

Permalink
Spring Cloud Consul 服务治理实现
Browse files Browse the repository at this point in the history
  • Loading branch information
javaddkk committed Dec 1, 2017
1 parent 754f263 commit 49d1524
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.ymq.example</groupId>
<artifactId>spring-cloud-eureka-client-consul</artifactId>
<artifactId>spring-cloud-consul</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>spring-cloud-eureka-client-consul</name>
<description>Eureka Client Consul Demo project for Spring Boot</description>
<name>spring-cloud-consul</name>
<description>Consul Demo project for Spring Boot</description>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -62,10 +62,14 @@

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
10 changes: 10 additions & 0 deletions spring-cloud-consul-client/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spring:
application:
name: consul-client
cloud:
consul:
host: 192.168.252.121
port: 8500
discovery:
healthCheckPath: /
healthCheckInterval: 5s
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.ymq.example.consul;

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 ConsulApplicationTests {

@Test
public void contextLoads() {
}

}

This file was deleted.

0 comments on commit 49d1524

Please sign in to comment.