diff --git a/sentinel-adapter/sentinel-apache-dubbo-adapter/pom.xml b/sentinel-adapter/sentinel-apache-dubbo-adapter/pom.xml
index 5ccf18467c..44f799db5e 100644
--- a/sentinel-adapter/sentinel-apache-dubbo-adapter/pom.xml
+++ b/sentinel-adapter/sentinel-apache-dubbo-adapter/pom.xml
@@ -15,7 +15,7 @@
1.8
1.8
- 2.7.3
+ 2.7.5
diff --git a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/BaseSentinelDubboFilter.java b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/BaseSentinelDubboFilter.java
index 9ea01e59da..bc2101ffb2 100644
--- a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/BaseSentinelDubboFilter.java
+++ b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/BaseSentinelDubboFilter.java
@@ -22,11 +22,7 @@
import com.alibaba.csp.sentinel.context.ContextUtil;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.constants.CommonConstants;
-import org.apache.dubbo.rpc.Invocation;
-import org.apache.dubbo.rpc.Invoker;
-import org.apache.dubbo.rpc.ListenableFilter;
-import org.apache.dubbo.rpc.Result;
-import org.apache.dubbo.rpc.RpcContext;
+import org.apache.dubbo.rpc.*;
/**
* Base Class of the {@link SentinelDubboProviderFilter} and {@link SentinelDubboConsumerFilter}.
@@ -41,8 +37,16 @@ public BaseSentinelDubboFilter() {
static class SentinelDubboListener implements Listener {
- @Override
public void onResponse(Result appResponse, Invoker> invoker, Invocation invocation) {
+ onSuccess(appResponse, invoker);
+ }
+
+ //for compatible dubbo 2.7.5 rename onResponse to onMessage
+ public void onMessage(Result appResponse, Invoker> invoker, Invocation invocation) {
+ onSuccess(appResponse, invoker);
+ }
+
+ private void onSuccess(Result appResponse, Invoker> invoker) {
if (DubboConfig.getDubboBizExceptionTraceEnabled()) {
traceAndExit(appResponse.getException(), invoker.getUrl());
} else {
diff --git a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilterTest.java b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilterTest.java
index 8c8721e1e8..60a7de2248 100644
--- a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilterTest.java
+++ b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilterTest.java
@@ -70,6 +70,6 @@ public void testInvokeNullApplicationKey() {
verify(invoker).invoke(invocation);
String application = RpcContext.getContext().getAttachment(DubboUtils.SENTINEL_DUBBO_APPLICATION_KEY);
- assertNull(application);
+ assertEquals(application, "");
}
}
diff --git a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilterTest.java b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilterTest.java
index f949231bc3..ea69ab8bdb 100644
--- a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilterTest.java
+++ b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilterTest.java
@@ -227,7 +227,7 @@ public Result requestGo(boolean exception, Invocation currentInvocation) {
}
public Result responseBack(Result result) {
- filter.listener().onResponse(result, invoker, invocation);
+ filter.listener().onMessage(result, invoker, invocation);
return result;
}
@@ -265,7 +265,7 @@ public void testInvokeSync() {
filter.invoke(invoker, invocation);
verify(invoker).invoke(invocation);
- filter.listener().onResponse(result, invoker, invocation);
+ filter.listener().onMessage(result, invoker, invocation);
Context context = ContextUtil.getContext();
assertNull(context);
}
diff --git a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilterTest.java b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilterTest.java
index 1a7000f1d6..ed97800a41 100644
--- a/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilterTest.java
+++ b/sentinel-adapter/sentinel-apache-dubbo-adapter/src/test/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilterTest.java
@@ -89,7 +89,7 @@ public void testInvoke() {
filter.invoke(invoker, invocation);
verify(invoker).invoke(invocation);
- filter.listener().onResponse(result, invoker, invocation);
+ filter.listener().onMessage(result, invoker, invocation);
Context context = ContextUtil.getContext();
assertNull(context);
}