增加 eureka 客户端实例

This commit is contained in:
Administrator
2020-10-28 23:21:51 +08:00
parent 03b37a2732
commit b9a0dd86f4
8 changed files with 104 additions and 2 deletions

View File

@ -0,0 +1,29 @@
<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>
<parent>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-parent</artifactId>
<version>0.0.1</version>
</parent>
<groupId>com.chinaunicom.mall.ebtp.cloud</groupId>
<artifactId>eureka-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>eureka-example</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-eureka-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,15 @@
package com.chinaunicom.mall.ebtp.cloud.eureka.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import com.chinaunicom.mall.ebtp.cloud.eureka.starter.EurekaStarterConfiguration;
@SpringBootApplication
@Import(EurekaStarterConfiguration.class)
public class EurekaClientApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaClientApplication.class, args);
}
}

View File

@ -0,0 +1,12 @@
server:
port: 8082
max-http-header-size: 1000000
spring:
application:
name: eureka-example
# 胜智云eureka 统一配置 (以下内容已在starter中配置好如无必要无需定义)
# eureka.client.service-url.defaultZone=http://192.168.40.17:12093/eureka/,http://192.168.40.17:18126/eureka/,http://192.168.40.17:28641/eureka/
# eureka.instance.prefer-ip-address=true
# eureka.instance.instance-id=${spring.cloud.client.ip-address}:${server.port}

View File

@ -0,0 +1,38 @@
package com.chinaunicom.mall.ebtp.cloud.eureka.example;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}

View File

@ -1,2 +0,0 @@
server:
port: 8082

View File

@ -0,0 +1,3 @@
server:
port: 8072

View File

@ -0,0 +1,3 @@
spring:
profiles:
active: dev

View File

@ -32,5 +32,9 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.chinaunicom.ebtp</groupId>
<artifactId>mall-ebtp-cloud-mvc-starter</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>