Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
08bcd901
Commit
08bcd901
authored
May 02, 2018
by
技术部-高工-张恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除一些不必要的依赖和kafka的默认地址
parent
268b64b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
60 deletions
+26
-60
pom.xml
brave-spring-boot-starter/pom.xml
+5
-55
BraveAutoConfiguration.java
...roup/tech/brave/configuration/BraveAutoConfiguration.java
+20
-4
BraveProperties.java
.../cn/quantgroup/tech/brave/properties/BraveProperties.java
+1
-1
No files found.
brave-spring-boot-starter/pom.xml
View file @
08bcd901
...
...
@@ -12,8 +12,6 @@
<artifactId>
brave-spring-boot-starter
</artifactId>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<spring.version>
4.3.8.RELEASE
</spring.version>
<brave.version>
4.19.1
</brave.version>
...
...
@@ -45,53 +43,10 @@
<artifactId>
httpclient
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.4
</version>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
16.0.1
</version>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
</dependency>
<dependency>
<groupId>
commons-cli
</groupId>
<artifactId>
commons-cli
</artifactId>
<version>
1.3.1
</version>
</dependency>
<dependency>
<groupId>
commons-net
</groupId>
<artifactId>
commons-net
</artifactId>
<version>
3.3
</version>
</dependency>
<dependency>
<groupId>
com.jcraft
</groupId>
<artifactId>
jsch
</artifactId>
<version>
0.1.53
</version>
</dependency>
<dependency>
<groupId>
ch.ethz.ganymed
</groupId>
<artifactId>
ganymed-ssh2
</artifactId>
<version>
262
</version>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
<version>
1.10
</version>
</dependency>
<dependency>
<groupId>
commons-collections
</groupId>
<artifactId>
commons-collections
</artifactId>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.4
</version>
<version>
${guava.version}
</version>
</dependency>
<dependency>
...
...
@@ -99,11 +54,6 @@
<artifactId>
lombok
</artifactId>
<version>
1.16.6
</version>
</dependency>
<dependency>
<groupId>
commons-validator
</groupId>
<artifactId>
commons-validator
</artifactId>
<version>
1.4.1
</version>
</dependency>
<dependency>
<groupId>
com.squareup.okhttp3
</groupId>
<artifactId>
okhttp
</artifactId>
...
...
@@ -154,15 +104,15 @@
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
</dependency>
<dependency>
<groupId>
io.zipkin.brave
</groupId>
<artifactId>
brave-context-log4j2
</artifactId>
<version>
${brave.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-jul
</artifactId>
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/configuration/BraveAutoConfiguration.java
View file @
08bcd901
...
...
@@ -23,8 +23,12 @@ import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Condition
;
import
org.springframework.context.annotation.ConditionContext
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.core.type.AnnotatedTypeMetadata
;
import
org.springframework.http.client.ClientHttpRequestInterceptor
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
...
...
@@ -49,11 +53,23 @@ import java.util.List;
@Slf4j
@Configuration
@AutoConfigureOrder
@Conditional
(
BraveAutoConfiguration
.
BraveSet
.
class
)
public
class
BraveAutoConfiguration
{
static
final
class
BraveSet
implements
Condition
{
@Override
public
boolean
matches
(
ConditionContext
context
,
AnnotatedTypeMetadata
a
)
{
return
!
isEmpty
(
context
.
getEnvironment
().
getProperty
(
"tech.brave.enabled"
));
}
private
static
boolean
isEmpty
(
String
s
)
{
return
s
==
null
||
s
.
isEmpty
();
}
}
@Configuration
@EnableWebMvc
@EnableConfigurationProperties
(
BraveProperties
.
class
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"false"
)
@ConditionalOnProperty
(
prefix
=
"tech.brave"
,
name
=
"enabled"
,
havingValue
=
"false"
)
public
static
class
BraveUntEnabled
{
/**
* 提供HttpClientBuilderBean
...
...
@@ -93,7 +109,7 @@ public class BraveAutoConfiguration {
*
* @return
*/
@Bean
(
name
=
"teachRabbitTemplateBuilder"
)
@Bean
(
name
=
"techRabbitTemplateBuilder"
)
public
IRabbitTemplateBuilder
rabbitTemplateBuilder
()
{
return
new
RabbitTemplateBuilderNoTrace
();
}
...
...
@@ -117,7 +133,7 @@ public class BraveAutoConfiguration {
@Bean
Sender
sender
()
{
return
KafkaSender
.
newBuilder
().
bootstrapServers
(
braveProperties
.
getKafka
Host
()).
topic
(
braveProperties
.
getKafkaTopic
()).
encoding
(
Encoding
.
JSON
).
build
();
return
KafkaSender
.
newBuilder
().
bootstrapServers
(
braveProperties
.
getKafka
BootstrapServers
()).
topic
(
braveProperties
.
getKafkaTopic
()).
encoding
(
Encoding
.
JSON
).
build
();
}
@Bean
...
...
@@ -146,7 +162,7 @@ public class BraveAutoConfiguration {
* @param tracing
* @return
*/
@Bean
(
name
=
"teachRabbitTemplateBuilder"
)
@Bean
(
name
=
"techRabbitTemplateBuilder"
)
public
IRabbitTemplateBuilder
rabbitTemplateBuilder
(
Tracing
tracing
)
{
return
new
RabbitTemplateBuilderTrace
(
tracing
);
}
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/properties/BraveProperties.java
View file @
08bcd901
...
...
@@ -20,7 +20,7 @@ public class BraveProperties {
/**
* kafka地址
*/
private
String
kafka
Host
=
"localhost:9092
"
;
private
String
kafka
BootstrapServers
=
"172.30.220.11:16091,172.30.220.11:16092,172.30.220.11:16093
"
;
/**
* kafka的topic
...
...
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