增加服务发现注册功能
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud.version>Edgware.SR5</spring-cloud.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -138,6 +139,12 @@
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-eureka</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -184,4 +191,15 @@
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.gzzn.omms.msgexchangeapi;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EnableEurekaClient
|
||||
public class MsgexchangeApiApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -85,3 +85,9 @@ elasticsearch:
|
||||
#注意cluster.name需要与config/elasticsearch.yml中的cluster.name一致
|
||||
cluster:
|
||||
name: docker-cluster
|
||||
eureka:
|
||||
client:
|
||||
service-url:
|
||||
defaultZone: http://130.120.3.231:94/eureka/
|
||||
instance:
|
||||
prefer-ip-address: true
|
||||
@@ -1,3 +1,5 @@
|
||||
spring:
|
||||
application:
|
||||
name: msgexchangeapi
|
||||
profiles:
|
||||
active: dev
|
||||
Reference in New Issue
Block a user