diff --git a/apm-agent-plugins/apm-spring-webflux/apm-spring-webclient-plugin/src/main/java/co/elastic/apm/agent/springwebclient/WebClientSubscriber.java b/apm-agent-plugins/apm-spring-webflux/apm-spring-webclient-plugin/src/main/java/co/elastic/apm/agent/springwebclient/WebClientSubscriber.java index e86d0c750e5..82c7bd5459d 100755 --- a/apm-agent-plugins/apm-spring-webflux/apm-spring-webclient-plugin/src/main/java/co/elastic/apm/agent/springwebclient/WebClientSubscriber.java +++ b/apm-agent-plugins/apm-spring-webflux/apm-spring-webclient-plugin/src/main/java/co/elastic/apm/agent/springwebclient/WebClientSubscriber.java @@ -74,7 +74,7 @@ public void onNext(T t) { try { if (span != null && t instanceof ClientResponse) { ClientResponse clientResponse = (ClientResponse) t; - int statusCode = clientResponse.rawStatusCode(); + int statusCode = clientResponse.statusCode().value(); span.withOutcome(ResultUtil.getOutcomeByHttpClientStatus(statusCode)); span.getContext().getHttp().withStatusCode(statusCode); } diff --git a/apm-agent-plugins/apm-spring-webflux/apm-spring-webflux-testapp/src/main/java/co/elastic/apm/agent/springwebflux/testapp/GreetingWebClient.java b/apm-agent-plugins/apm-spring-webflux/apm-spring-webflux-testapp/src/main/java/co/elastic/apm/agent/springwebflux/testapp/GreetingWebClient.java index 49778ccbe8d..ce04c80741a 100644 --- a/apm-agent-plugins/apm-spring-webflux/apm-spring-webflux-testapp/src/main/java/co/elastic/apm/agent/springwebflux/testapp/GreetingWebClient.java +++ b/apm-agent-plugins/apm-spring-webflux/apm-spring-webflux-testapp/src/main/java/co/elastic/apm/agent/springwebflux/testapp/GreetingWebClient.java @@ -222,7 +222,7 @@ private WebClient.ResponseSpec request(String method, Function .headers(httpHeaders -> httpHeaders.addAll(headers)) .cookies(httpCookies -> httpCookies.addAll(cookies)) .retrieve() - .onRawStatus(status -> status != expectedStatus, r -> Mono.error(new IllegalStateException(String.format("unexpected response status %d", r.rawStatusCode())))); + .onRawStatus(status -> status != expectedStatus, r -> Mono.error(new IllegalStateException(String.format("unexpected response status %d", r.statusCode().value())))); } @Override diff --git a/apm-agent-plugins/apm-spring-webflux/pom.xml b/apm-agent-plugins/apm-spring-webflux/pom.xml index a8c08366da6..34abfc9b723 100644 --- a/apm-agent-plugins/apm-spring-webflux/pom.xml +++ b/apm-agent-plugins/apm-spring-webflux/pom.xml @@ -18,7 +18,7 @@ 2.7.16 - 3.1.5 + 3.2.0