Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
b2af4575
Commit
b2af4575
authored
Jun 28, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构测试类结构
parent
8c2e21d0
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
92 additions
and
465 deletions
+92
-465
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication.java
+8
-0
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/controller/DiscoveryController.java
+40
-1
discovery-springcloud-example-b/pom.xml
+2
-2
discovery-springcloud-example-b/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationB1.java
+4
-2
discovery-springcloud-example-b/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationB2.java
+4
-2
discovery-springcloud-example-b/src/main/java/com/nepxion/discovery/plugin/example/controller/DiscoveryController.java
+1
-1
discovery-springcloud-example-b/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigAdapter.java
+0
-0
discovery-springcloud-example-b/src/main/resources/application-1.properties
+6
-0
discovery-springcloud-example-b/src/main/resources/application-2.properties
+2
-6
discovery-springcloud-example-b/src/main/resources/bootstrap.properties
+0
-4
discovery-springcloud-example-b/src/main/resources/logback.xml
+0
-0
discovery-springcloud-example-b/src/main/resources/rule.xml
+0
-0
discovery-springcloud-example-b2/pom.xml
+0
-69
discovery-springcloud-example-b2/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryController.java
+0
-31
discovery-springcloud-example-b2/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigAdapter.java
+0
-37
discovery-springcloud-example-b2/src/main/resources/rule.xml
+0
-14
discovery-springcloud-example-c/pom.xml
+2
-2
discovery-springcloud-example-c/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC1.java
+5
-2
discovery-springcloud-example-c/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC2.java
+5
-2
discovery-springcloud-example-c/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC3.java
+5
-2
discovery-springcloud-example-c/src/main/resources/application-1.properties
+4
-0
discovery-springcloud-example-c/src/main/resources/application-2.properties
+0
-4
discovery-springcloud-example-c/src/main/resources/application-3.properties
+0
-4
discovery-springcloud-example-c/src/main/resources/bootstrap.properties
+2
-4
discovery-springcloud-example-c/src/main/resources/logback.xml
+0
-0
discovery-springcloud-example-c1/src/main/resources/logback.xml
+0
-49
discovery-springcloud-example-c2/pom.xml
+0
-62
discovery-springcloud-example-c2/src/main/resources/logback.xml
+0
-49
discovery-springcloud-example-c3/pom.xml
+0
-62
discovery-springcloud-example-c3/src/main/resources/logback.xml
+0
-49
pom.xml
+2
-5
No files found.
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication.java
View file @
b2af4575
...
...
@@ -12,7 +12,9 @@ package com.nepxion.discovery.plugin.example;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.loadbalancer.LoadBalanced
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.web.client.RestTemplate
;
import
com.nepxion.discovery.plugin.example.extension.MyDiscoveryListener
;
import
com.nepxion.discovery.plugin.example.extension.MyRegisterListener
;
...
...
@@ -26,6 +28,12 @@ public class DiscoveryApplication {
}
@Bean
@LoadBalanced
public
RestTemplate
restTemplate
()
{
return
new
RestTemplate
();
}
@Bean
public
DiscoveryConfigAdapter
discoveryConfigAdapter
()
{
return
new
DiscoveryConfigAdapter
();
}
...
...
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryController.java
→
discovery-springcloud-example-a/src/main/java/com/nepxion/discovery/plugin/example/
controller/
DiscoveryController.java
View file @
b2af4575
package
com
.
nepxion
.
discovery
.
plugin
.
example
;
package
com
.
nepxion
.
discovery
.
plugin
.
example
.
controller
;
/**
* <p>Title: Nepxion Discovery</p>
...
...
@@ -9,22 +9,60 @@ package com.nepxion.discovery.plugin.example;
* @version 1.0
*/
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
com.nepxion.discovery.plugin.framework.constant.PluginConstant
;
@RestController
public
class
DiscoveryController
{
@Autowired
private
DiscoveryClient
discoveryClient
;
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${"
+
PluginConstant
.
SPRING_APPLICATION_NAME
+
"}"
)
private
String
serviceId
;
@Value
(
"${"
+
PluginConstant
.
EUREKA_METADATA_VERSION
+
"}"
)
private
String
eurekaVersion
;
@RequestMapping
(
path
=
"/instances"
,
method
=
RequestMethod
.
GET
)
public
List
<
ServiceInstance
>
instances
()
{
return
discoveryClient
.
getInstances
(
"discovery-springcloud-example-b"
);
}
@RequestMapping
(
path
=
"/routes"
,
method
=
RequestMethod
.
GET
)
@SuppressWarnings
(
"unchecked"
)
public
List
<
String
>
routes
()
{
List
<
String
>
routes
=
new
ArrayList
<
String
>();
// 获取B服务的实例列表
List
<
ServiceInstance
>
bInstances
=
instances
();
// 获取C服务的实例列表
List
<
ServiceInstance
>
cInstances
=
(
List
<
ServiceInstance
>)
restTemplate
.
getForEntity
(
"http://discovery-springcloud-example-b/instances"
,
List
.
class
);
for
(
ServiceInstance
bInstance
:
bInstances
)
{
String
aInfo
=
serviceId
+
"["
+
eurekaVersion
+
"]"
;
String
bInfo
=
bInstance
.
getServiceId
()
+
"["
+
bInstance
.
getMetadata
().
get
(
PluginConstant
.
EUREKA_METADATA_VERSION
)
+
"]"
;
for
(
ServiceInstance
cInstance
:
cInstances
)
{
String
cInfo
=
cInstance
.
getServiceId
()
+
"["
+
cInstance
.
getMetadata
().
get
(
PluginConstant
.
EUREKA_METADATA_VERSION
)
+
"]"
;
StringBuilder
stringBuilder
=
new
StringBuilder
();
routes
.
add
(
stringBuilder
.
append
(
aInfo
).
append
(
"->"
).
append
(
bInfo
).
append
(
"->"
).
append
(
cInfo
).
toString
());
}
}
return
routes
;
}
}
\ No newline at end of file
discovery-springcloud-example-b
1
/pom.xml
→
discovery-springcloud-example-b/pom.xml
View file @
b2af4575
...
...
@@ -2,8 +2,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"
>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-springcloud-example-b
1
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example B
1
</name>
<artifactId>
discovery-springcloud-example-b
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example B
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0.0
</version>
...
...
discovery-springcloud-example-b
1/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication
.java
→
discovery-springcloud-example-b
/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationB1
.java
View file @
b2af4575
...
...
@@ -18,9 +18,11 @@ import com.nepxion.discovery.plugin.example.impl.DiscoveryConfigAdapter;
@SpringBootApplication
@EnableDiscoveryClient
public
class
DiscoveryApplication
{
public
class
DiscoveryApplication
B1
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
DiscoveryApplication
.
class
).
web
(
true
).
run
(
args
);
System
.
setProperty
(
"spring.profiles.active"
,
"1"
);
new
SpringApplicationBuilder
(
DiscoveryApplicationB1
.
class
).
web
(
true
).
run
(
args
);
}
@Bean
...
...
discovery-springcloud-example-b
2/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication
.java
→
discovery-springcloud-example-b
/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationB2
.java
View file @
b2af4575
...
...
@@ -18,9 +18,11 @@ import com.nepxion.discovery.plugin.example.impl.DiscoveryConfigAdapter;
@SpringBootApplication
@EnableDiscoveryClient
public
class
DiscoveryApplication
{
public
class
DiscoveryApplication
B2
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
DiscoveryApplication
.
class
).
web
(
true
).
run
(
args
);
System
.
setProperty
(
"spring.profiles.active"
,
"2"
);
new
SpringApplicationBuilder
(
DiscoveryApplicationB2
.
class
).
web
(
true
).
run
(
args
);
}
@Bean
...
...
discovery-springcloud-example-b
1/src/main/java/com/nepxion/discovery/plugin/example
/DiscoveryController.java
→
discovery-springcloud-example-b
/src/main/java/com/nepxion/discovery/plugin/example/controller
/DiscoveryController.java
View file @
b2af4575
package
com
.
nepxion
.
discovery
.
plugin
.
example
;
package
com
.
nepxion
.
discovery
.
plugin
.
example
.
controller
;
/**
* <p>Title: Nepxion Discovery</p>
...
...
discovery-springcloud-example-b
1
/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigAdapter.java
→
discovery-springcloud-example-b/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigAdapter.java
View file @
b2af4575
File moved
discovery-springcloud-example-b/src/main/resources/application-1.properties
0 → 100644
View file @
b2af4575
# Spring cloud config
server.port
=
1200
eureka.instance.metadataMap.version
=
1.0
management.port
=
8200
\ No newline at end of file
discovery-springcloud-example-b
2/src/main/resources/application
.properties
→
discovery-springcloud-example-b
/src/main/resources/application-2
.properties
View file @
b2af4575
# Spring cloud config
spring.application.name
=
discovery-springcloud-example-b
server.port
=
1201
eureka.client.serviceUrl.defaultZone
=
http://10.0.75.1:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.1
management.port
=
8201
management.security.enabled
=
false
\ No newline at end of file
management.port
=
8201
\ No newline at end of file
discovery-springcloud-example-b
1/src/main/resources/application
.properties
→
discovery-springcloud-example-b
/src/main/resources/bootstrap
.properties
View file @
b2af4575
# Spring cloud config
spring.application.name
=
discovery-springcloud-example-b
server.port
=
1200
eureka.client.serviceUrl.defaultZone
=
http://10.0.75.1:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.0
management.port
=
8200
management.security.enabled
=
false
\ No newline at end of file
discovery-springcloud-example-b
1
/src/main/resources/logback.xml
→
discovery-springcloud-example-b/src/main/resources/logback.xml
View file @
b2af4575
File moved
discovery-springcloud-example-b
1
/src/main/resources/rule.xml
→
discovery-springcloud-example-b/src/main/resources/rule.xml
View file @
b2af4575
File moved
discovery-springcloud-example-b2/pom.xml
deleted
100644 → 0
View file @
8c2e21d0
<?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"
>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-springcloud-example-b2
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example B2
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0.0
</version>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<url>
http://www.nepxion.com
</url>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.6.RELEASE
</version>
</parent>
<properties>
<spring.cloud.version>
Dalston.SR5
</spring.cloud.version>
<!-- <spring.cloud.version>Edgware.SR3</spring.cloud.version> -->
<discovery.plugin.version>
2.0.10
</discovery.plugin.version>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<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>
<dependencies>
<dependency>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-plugin-starter
</artifactId>
<version>
${discovery.plugin.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<compilerArgs>
<arg>
-parameters
</arg>
</compilerArgs>
<encoding>
${project.build.sourceEncoding}
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
discovery-springcloud-example-b2/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryController.java
deleted
100644 → 0
View file @
8c2e21d0
package
com
.
nepxion
.
discovery
.
plugin
.
example
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
DiscoveryController
{
@Autowired
private
DiscoveryClient
discoveryClient
;
@RequestMapping
(
path
=
"/instances"
,
method
=
RequestMethod
.
GET
)
public
List
<
ServiceInstance
>
instances
()
{
return
discoveryClient
.
getInstances
(
"discovery-springcloud-example-c"
);
}
}
\ No newline at end of file
discovery-springcloud-example-b2/src/main/java/com/nepxion/discovery/plugin/example/impl/DiscoveryConfigAdapter.java
deleted
100644 → 0
View file @
8c2e21d0
package
com
.
nepxion
.
discovery
.
plugin
.
example
.
impl
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
org.apache.commons.io.FileUtils
;
import
com.nepxion.discovery.plugin.configcenter.ConfigAdapter
;
public
class
DiscoveryConfigAdapter
extends
ConfigAdapter
{
@Override
protected
String
getLocalContextPath
()
{
return
"classpath:rule.xml"
;
}
@Override
public
InputStream
getRemoteInputStream
()
{
try
{
return
FileUtils
.
openInputStream
(
new
File
(
"src/main/resources/rule.xml"
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
\ No newline at end of file
discovery-springcloud-example-b2/src/main/resources/rule.xml
deleted
100644 → 0
View file @
8c2e21d0
<?xml version="1.0" encoding="UTF-8"?>
<rule>
<discovery>
<version>
<!-- 表示消费端服务a的1.0,允许访问提供端服务b的1.0和1.1版本 -->
<service
consumer-service-name=
"discovery-springcloud-example-a"
provider-service-name=
"discovery-springcloud-example-b"
consumer-version-value=
"1.0"
provider-version-value=
"1.0;1.1"
/>
<!-- 表示消费端服务b的1.0,允许访问提供端服务c的1.0和1.1版本 -->
<service
consumer-service-name=
"discovery-springcloud-example-b"
provider-service-name=
"discovery-springcloud-example-c"
consumer-version-value=
"1.0"
provider-version-value=
"1.0;1.1"
/>
<!-- 表示消费端服务b的1.1,允许访问提供端服务c的1.2版本 -->
<service
consumer-service-name=
"discovery-springcloud-example-b"
provider-service-name=
"discovery-springcloud-example-c"
consumer-version-value=
"1.1"
provider-version-value=
"1.2"
/>
</version>
</discovery>
</rule>
\ No newline at end of file
discovery-springcloud-example-c
1
/pom.xml
→
discovery-springcloud-example-c/pom.xml
View file @
b2af4575
...
...
@@ -2,8 +2,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"
>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-springcloud-example-c
1
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example C
1
</name>
<artifactId>
discovery-springcloud-example-c
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example C
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0.0
</version>
...
...
discovery-springcloud-example-c
1/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication
.java
→
discovery-springcloud-example-c
/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC1
.java
View file @
b2af4575
...
...
@@ -15,8 +15,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public
class
DiscoveryApplication
{
public
class
DiscoveryApplication
C1
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
DiscoveryApplication
.
class
).
web
(
true
).
run
(
args
);
System
.
setProperty
(
"spring.profiles.active"
,
"1"
);
new
SpringApplicationBuilder
(
DiscoveryApplicationC1
.
class
).
web
(
true
).
run
(
args
);
}
}
\ No newline at end of file
discovery-springcloud-example-c
2/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication
.java
→
discovery-springcloud-example-c
/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC2
.java
View file @
b2af4575
...
...
@@ -15,8 +15,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public
class
DiscoveryApplication
{
public
class
DiscoveryApplication
C2
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
DiscoveryApplication
.
class
).
web
(
true
).
run
(
args
);
System
.
setProperty
(
"spring.profiles.active"
,
"2"
);
new
SpringApplicationBuilder
(
DiscoveryApplicationC2
.
class
).
web
(
true
).
run
(
args
);
}
}
\ No newline at end of file
discovery-springcloud-example-c
3/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplication
.java
→
discovery-springcloud-example-c
/src/main/java/com/nepxion/discovery/plugin/example/DiscoveryApplicationC3
.java
View file @
b2af4575
...
...
@@ -15,8 +15,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public
class
DiscoveryApplication
{
public
class
DiscoveryApplication
C3
{
public
static
void
main
(
String
[]
args
)
{
new
SpringApplicationBuilder
(
DiscoveryApplication
.
class
).
web
(
true
).
run
(
args
);
System
.
setProperty
(
"spring.profiles.active"
,
"3"
);
new
SpringApplicationBuilder
(
DiscoveryApplicationC3
.
class
).
web
(
true
).
run
(
args
);
}
}
\ No newline at end of file
discovery-springcloud-example-c/src/main/resources/application-1.properties
0 → 100644
View file @
b2af4575
# Spring cloud config
server.port
=
1300
eureka.instance.metadataMap.version
=
1.0
\ No newline at end of file
discovery-springcloud-example-c
2/src/main/resources/application
.properties
→
discovery-springcloud-example-c
/src/main/resources/application-2
.properties
View file @
b2af4575
# Spring cloud config
spring.application.name
=
discovery-springcloud-example-c
server.port
=
1301
eureka.client.serviceUrl.defaultZone
=
http://10.0.75.1:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.1
\ No newline at end of file
discovery-springcloud-example-c
3/src/main/resources/application
.properties
→
discovery-springcloud-example-c
/src/main/resources/application-3
.properties
View file @
b2af4575
# Spring cloud config
spring.application.name
=
discovery-springcloud-example-c
server.port
=
1302
eureka.client.serviceUrl.defaultZone
=
http://10.0.75.1:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.2
\ No newline at end of file
discovery-springcloud-example-c
1/src/main/resources/application
.properties
→
discovery-springcloud-example-c
/src/main/resources/bootstrap
.properties
View file @
b2af4575
# Spring cloud config
spring.application.name
=
discovery-springcloud-example-c
server.port
=
1300
eureka.client.serviceUrl.defaultZone
=
http://10.0.75.1:9528/eureka/
eureka.instance.preferIpAddress
=
true
eureka.instance.metadataMap.version
=
1.0
\ No newline at end of file
eureka.instance.preferIpAddress
=
true
\ No newline at end of file
discovery-springcloud-example-
b2
/src/main/resources/logback.xml
→
discovery-springcloud-example-
c
/src/main/resources/logback.xml
View file @
b2af4575
File moved
discovery-springcloud-example-c1/src/main/resources/logback.xml
deleted
100644 → 0
View file @
8c2e21d0
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<!-- Simple file output -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<fileNamePattern>
log/discovery-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>
50MB
</maxFileSize>
</rollingPolicy>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>
true
</prudent>
</appender>
<appender
name =
"FILE_ASYNC"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
512
</queueSize>
<appender-ref
ref =
"FILE"
/>
</appender>
<!-- Console output -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- Only log level WARN and above -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
</appender>
<!-- For loggers in the these namespaces, log at all levels. -->
<logger
name=
"pedestal"
level=
"ALL"
/>
<logger
name=
"hammock-cafe"
level=
"ALL"
/>
<logger
name=
"user"
level=
"ALL"
/>
<root
level=
"INFO"
>
<!-- <appender-ref ref="FILE_ASYNC" /> -->
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
discovery-springcloud-example-c2/pom.xml
deleted
100644 → 0
View file @
8c2e21d0
<?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"
>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-springcloud-example-c2
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example C2
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0.0
</version>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<url>
http://www.nepxion.com
</url>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.6.RELEASE
</version>
</parent>
<properties>
<spring.cloud.version>
Dalston.SR5
</spring.cloud.version>
<!-- <spring.cloud.version>Edgware.SR3</spring.cloud.version> -->
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<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>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<compilerArgs>
<arg>
-parameters
</arg>
</compilerArgs>
<encoding>
${project.build.sourceEncoding}
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
discovery-springcloud-example-c2/src/main/resources/logback.xml
deleted
100644 → 0
View file @
8c2e21d0
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<!-- Simple file output -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<fileNamePattern>
log/discovery-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>
50MB
</maxFileSize>
</rollingPolicy>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>
true
</prudent>
</appender>
<appender
name =
"FILE_ASYNC"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
512
</queueSize>
<appender-ref
ref =
"FILE"
/>
</appender>
<!-- Console output -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- Only log level WARN and above -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
</appender>
<!-- For loggers in the these namespaces, log at all levels. -->
<logger
name=
"pedestal"
level=
"ALL"
/>
<logger
name=
"hammock-cafe"
level=
"ALL"
/>
<logger
name=
"user"
level=
"ALL"
/>
<root
level=
"INFO"
>
<!-- <appender-ref ref="FILE_ASYNC" /> -->
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
discovery-springcloud-example-c3/pom.xml
deleted
100644 → 0
View file @
8c2e21d0
<?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"
>
<groupId>
com.nepxion
</groupId>
<artifactId>
discovery-springcloud-example-c3
</artifactId>
<name>
Nepxion Discovery Spring Cloud Example C3
</name>
<packaging>
jar
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<version>
1.0.0
</version>
<description>
Nepxion Discovery is an enhancement for Spring Cloud Discovery
</description>
<url>
http://www.nepxion.com
</url>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.6.RELEASE
</version>
</parent>
<properties>
<spring.cloud.version>
Dalston.SR5
</spring.cloud.version>
<!-- <spring.cloud.version>Edgware.SR3</spring.cloud.version> -->
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<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>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-eureka
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<compilerArgs>
<arg>
-parameters
</arg>
</compilerArgs>
<encoding>
${project.build.sourceEncoding}
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
discovery-springcloud-example-c3/src/main/resources/logback.xml
deleted
100644 → 0
View file @
8c2e21d0
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<configuration
scan=
"true"
scanPeriod=
"10 seconds"
>
<!-- Simple file output -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<fileNamePattern>
log/discovery-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>
50MB
</maxFileSize>
</rollingPolicy>
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>
true
</prudent>
</appender>
<appender
name =
"FILE_ASYNC"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
512
</queueSize>
<appender-ref
ref =
"FILE"
/>
</appender>
<!-- Console output -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>
discovery %date %level [%thread] %logger{10} [%file:%line] - %msg%n
</pattern>
<charset>
UTF-8
</charset>
</encoder>
<!-- Only log level WARN and above -->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
INFO
</level>
</filter>
</appender>
<!-- For loggers in the these namespaces, log at all levels. -->
<logger
name=
"pedestal"
level=
"ALL"
/>
<logger
name=
"hammock-cafe"
level=
"ALL"
/>
<logger
name=
"user"
level=
"ALL"
/>
<root
level=
"INFO"
>
<!-- <appender-ref ref="FILE_ASYNC" /> -->
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
pom.xml
View file @
b2af4575
...
...
@@ -16,11 +16,8 @@
<module>
discovery-plugin-admin-center
</module>
<module>
discovery-plugin-starter
</module>
<module>
discovery-springcloud-example-a
</module>
<module>
discovery-springcloud-example-b1
</module>
<module>
discovery-springcloud-example-b2
</module>
<module>
discovery-springcloud-example-c1
</module>
<module>
discovery-springcloud-example-c2
</module>
<module>
discovery-springcloud-example-c3
</module>
<module>
discovery-springcloud-example-b
</module>
<module>
discovery-springcloud-example-c
</module>
</modules>
<properties>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment