Updates to lates Brave (#1736)

Notably, this fixes a missing localEndpoint.ip field
This commit is contained in:
Adrian Cole
2020-09-12 16:29:52 +08:00
committed by GitHub
parent cf3a082477
commit 65eafad90e
6 changed files with 45 additions and 21 deletions

View File

@@ -33,7 +33,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<spring-boot.version>2.3.3.RELEASE</spring-boot.version>
<brave.version>5.12.3</brave.version>
<brave.version>5.12.6</brave.version>
<okhttp.version>3.14.6</okhttp.version>
</properties>

View File

@@ -257,7 +257,7 @@
<spring-cloud-stream.version>Horsham.SR8</spring-cloud-stream.version>
<spring-cloud-netflix.version>2.2.6.BUILD-SNAPSHOT</spring-cloud-netflix.version>
<spring-cloud-openfeign.version>2.2.6.BUILD-SNAPSHOT</spring-cloud-openfeign.version>
<brave.version>5.12.3</brave.version>
<brave.version>5.12.6</brave.version>
<spring-security-boot-autoconfigure.version>2.1.7.RELEASE</spring-security-boot-autoconfigure.version>
<spring-cloud-aws.version>2.2.5.BUILD-SNAPSHOT</spring-cloud-aws.version>
<disable.nohttp.checks>false</disable.nohttp.checks>

View File

@@ -31,7 +31,7 @@
<name>spring-cloud-sleuth-dependencies</name>
<description>Spring Cloud Sleuth Dependencies</description>
<properties>
<brave.version>5.12.3</brave.version>
<brave.version>5.12.6</brave.version>
<brave.opentracing.version>0.37.2</brave.opentracing.version>
<grpc.spring.boot.version>3.4.1</grpc.spring.boot.version>
</properties>

View File

@@ -93,6 +93,12 @@ abstract class ITSpringConfiguredReactorClient
getMono(context, pathIncludingQuery).block();
}
@Override
final protected void options(AnnotationConfigApplicationContext context,
String path) {
optionsMono(context, path).block();
}
@Override
final protected void post(AnnotationConfigApplicationContext context,
String pathIncludingQuery, String body) {
@@ -105,14 +111,20 @@ abstract class ITSpringConfiguredReactorClient
TestHttpCallbackSubscriber.subscribe(getMono(context, path), callback);
}
/** Returns a {@link Mono} of the HTTP status code from the given "POST" request. */
abstract Mono<Integer> postMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery, String body);
/** Returns a {@link Mono} of the HTTP status code. */
abstract Mono<Integer> getMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery);
/**
* Returns a {@link Mono} of the HTTP status code from the given "OPTIONS" request.
*/
abstract Mono<Integer> optionsMono(AnnotationConfigApplicationContext context,
String path);
/** Returns a {@link Mono} of the HTTP status code from the given "POST" request. */
abstract Mono<Integer> postMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery, String body);
/**
* This assumes that implementations do not issue an HTTP request until
* {@link Subscription#request(long)} is called. Since a client span is only for

View File

@@ -70,6 +70,19 @@ public class ReactorNettyHttpClientBraveTests extends ITSpringConfiguredReactorC
super(HttpClientBeanPostProcessor.class);
}
@Override
Mono<Integer> getMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery) {
return context.getBean(HttpClient.class).get().uri(pathIncludingQuery).response()
.map(r -> r.status().code());
}
@Override
Mono<Integer> optionsMono(AnnotationConfigApplicationContext context, String path) {
return context.getBean(HttpClient.class).options().uri(path).response()
.map(r -> r.status().code());
}
@Override
Mono<Integer> postMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery, String body) {
@@ -78,11 +91,4 @@ public class ReactorNettyHttpClientBraveTests extends ITSpringConfiguredReactorC
.response().map(r -> r.status().code());
}
@Override
Mono<Integer> getMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery) {
return context.getBean(HttpClient.class).get().uri(pathIncludingQuery).response()
.map(r -> r.status().code());
}
}

View File

@@ -52,6 +52,19 @@ public class WebClientBraveTests extends ITSpringConfiguredReactorClient {
TraceWebClientBeanPostProcessor.class);
}
@Override
Mono<Integer> getMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery) {
return context.getBean(WebClient.Builder.class).build().get()
.uri(pathIncludingQuery).exchange().map(ClientResponse::rawStatusCode);
}
@Override
Mono<Integer> optionsMono(AnnotationConfigApplicationContext context, String path) {
return context.getBean(WebClient.Builder.class).build().options().uri(path)
.exchange().map(ClientResponse::rawStatusCode);
}
@Override
Mono<Integer> postMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery, String body) {
@@ -60,13 +73,6 @@ public class WebClientBraveTests extends ITSpringConfiguredReactorClient {
.map(ClientResponse::rawStatusCode);
}
@Override
Mono<Integer> getMono(AnnotationConfigApplicationContext context,
String pathIncludingQuery) {
return context.getBean(WebClient.Builder.class).build().get()
.uri(pathIncludingQuery).exchange().map(ClientResponse::rawStatusCode);
}
@Test
@Ignore("WebClient is blind to the implementation of redirects")
@Override