From 9842e43f3e5de3059860c65e8a46af2675a69655 Mon Sep 17 00:00:00 2001 From: Jaehong-Kim Date: Tue, 2 Jul 2024 17:45:45 +0900 Subject: [PATCH] [#11210] Update DispatcherHandler.handleResult() of spring webflux 6 --- .../plugin/spring/webflux/SpringWebFluxPlugin.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/agent-module/plugins/spring-webflux/src/main/java/com/navercorp/pinpoint/plugin/spring/webflux/SpringWebFluxPlugin.java b/agent-module/plugins/spring-webflux/src/main/java/com/navercorp/pinpoint/plugin/spring/webflux/SpringWebFluxPlugin.java index 661c9dc1b176..1ca01c269b92 100644 --- a/agent-module/plugins/spring-webflux/src/main/java/com/navercorp/pinpoint/plugin/spring/webflux/SpringWebFluxPlugin.java +++ b/agent-module/plugins/spring-webflux/src/main/java/com/navercorp/pinpoint/plugin/spring/webflux/SpringWebFluxPlugin.java @@ -123,11 +123,21 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin if (invokerHandlerMethod != null) { invokerHandlerMethod.addInterceptor(DispatchHandlerInvokeHandlerMethodInterceptor.class, va(this.uriStatEnable, Boolean.valueOf(false))); } + // 6.x + final InstrumentMethod handleRequestWithMethod = target.getDeclaredMethod("handleRequestWith", "org.springframework.web.server.ServerWebExchange", "java.lang.Object"); + if (handleRequestWithMethod != null) { + handleRequestWithMethod.addInterceptor(DispatchHandlerInvokeHandlerMethodInterceptor.class, va(this.uriStatEnable, Boolean.valueOf(false))); + } // Result final InstrumentMethod handleResultMethod = target.getDeclaredMethod("handleResult", "org.springframework.web.server.ServerWebExchange", "org.springframework.web.reactive.HandlerResult"); if (handleResultMethod != null) { handleResultMethod.addInterceptor(DispatchHandlerInvokeHandlerMethodInterceptor.class, va(this.uriStatEnable, this.uriStatUseUserInput)); } + // 6.x + final InstrumentMethod handleResultMethod2 = target.getDeclaredMethod("handleResult", "org.springframework.web.server.ServerWebExchange", "org.springframework.web.reactive.HandlerResult", "java.lang.String"); + if (handleResultMethod2 != null) { + handleResultMethod2.addInterceptor(DispatchHandlerInvokeHandlerMethodInterceptor.class, va(this.uriStatEnable, this.uriStatUseUserInput)); + } return target.toBytecode(); }