diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 2fc0f5b60c..5e964b2edd 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -14,7 +14,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> + --> + 4.0.0 @@ -193,6 +195,18 @@ pom import + + io.netty + netty-bom + ${netty4_version} + pom + import + + + io.netty + netty-all + ${netty4_version} + org.javassist javassist @@ -203,11 +217,6 @@ netty ${netty_version} - - io.netty - netty-all - ${netty4_version} - org.apache.mina mina-core diff --git a/dubbo-kubernetes/pom.xml b/dubbo-kubernetes/pom.xml index f5250b30a3..286857ebcc 100644 --- a/dubbo-kubernetes/pom.xml +++ b/dubbo-kubernetes/pom.xml @@ -49,11 +49,6 @@ dubbo-metadata-api ${project.parent.version} - - - io.netty - netty-all - io.fabric8 kubernetes-client diff --git a/dubbo-plugin/dubbo-qos/pom.xml b/dubbo-plugin/dubbo-qos/pom.xml index cdc6797bce..4586a6199a 100644 --- a/dubbo-plugin/dubbo-qos/pom.xml +++ b/dubbo-plugin/dubbo-qos/pom.xml @@ -70,9 +70,5 @@ dubbo-serialization-fastjson2 ${project.parent.version} - - io.netty - netty-all - diff --git a/dubbo-remoting/dubbo-remoting-api/pom.xml b/dubbo-remoting/dubbo-remoting-api/pom.xml index c9b06822ce..6ac711e3e3 100644 --- a/dubbo-remoting/dubbo-remoting-api/pom.xml +++ b/dubbo-remoting/dubbo-remoting-api/pom.xml @@ -42,7 +42,41 @@ io.netty - netty-all + netty-codec + compile + + + io.netty + netty-handler + compile + + + io.netty + netty-transport + compile + + + io.netty + netty-transport-classes-epoll + compile + + + io.netty + netty-transport-native-epoll + linux-aarch_64 + runtime + + + io.netty + netty-transport-native-kqueue + osx-x86_64 + runtime + + + io.netty + netty-transport-native-kqueue + osx-aarch_64 + runtime org.apache.dubbo diff --git a/dubbo-remoting/dubbo-remoting-netty4/pom.xml b/dubbo-remoting/dubbo-remoting-netty4/pom.xml index af48662c28..fb4c31784f 100644 --- a/dubbo-remoting/dubbo-remoting-netty4/pom.xml +++ b/dubbo-remoting/dubbo-remoting-netty4/pom.xml @@ -40,9 +40,11 @@ dubbo-remoting-api ${project.parent.version} + io.netty - netty-all + netty-handler-proxy + compile org.apache.dubbo diff --git a/dubbo-rpc/dubbo-rpc-rest/pom.xml b/dubbo-rpc/dubbo-rpc-rest/pom.xml index c8fc01ae50..25127469be 100644 --- a/dubbo-rpc/dubbo-rpc-rest/pom.xml +++ b/dubbo-rpc/dubbo-rpc-rest/pom.xml @@ -83,11 +83,6 @@ resteasy-jaxb-provider - - io.netty - netty-all - - io.swagger diff --git a/dubbo-rpc/dubbo-rpc-triple/pom.xml b/dubbo-rpc/dubbo-rpc-triple/pom.xml index 17f141a845..eeca0e6937 100644 --- a/dubbo-rpc/dubbo-rpc-triple/pom.xml +++ b/dubbo-rpc/dubbo-rpc-triple/pom.xml @@ -45,6 +45,10 @@ ${project.parent.version} test + + io.netty + netty-codec-http2 + com.google.protobuf protobuf-java diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/StatusRpcException.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/StatusRpcException.java similarity index 100% rename from dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/StatusRpcException.java rename to dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/StatusRpcException.java diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java similarity index 95% rename from dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java rename to dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java index 61540b78ea..11a250bcaf 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/TriRpcStatus.java @@ -83,7 +83,7 @@ public class TriRpcStatus { return new TriRpcStatus(code, throwable, description); } if (throwable instanceof TimeoutException) { - return new TriRpcStatus(TriRpcStatus.Code.DEADLINE_EXCEEDED, throwable, description); + return new TriRpcStatus(Code.DEADLINE_EXCEEDED, throwable, description); } return new TriRpcStatus(Code.UNKNOWN, throwable, description); } @@ -165,27 +165,27 @@ public class TriRpcStatus { return encoder.toString().substring(2); } - public static TriRpcStatus.Code httpStatusToGrpcCode(int httpStatusCode) { + public static Code httpStatusToGrpcCode(int httpStatusCode) { if (httpStatusCode >= 100 && httpStatusCode < 200) { - return TriRpcStatus.Code.INTERNAL; + return Code.INTERNAL; } if (httpStatusCode == HttpResponseStatus.BAD_REQUEST.code() || httpStatusCode == HttpResponseStatus.REQUEST_HEADER_FIELDS_TOO_LARGE.code() ) { - return TriRpcStatus.Code.INTERNAL; + return Code.INTERNAL; } else if (httpStatusCode == HttpResponseStatus.UNAUTHORIZED.code()) { - return TriRpcStatus.Code.UNAUTHENTICATED; + return Code.UNAUTHENTICATED; } else if (httpStatusCode == HttpResponseStatus.FORBIDDEN.code()) { - return TriRpcStatus.Code.PERMISSION_DENIED; + return Code.PERMISSION_DENIED; } else if (httpStatusCode == HttpResponseStatus.NOT_FOUND.code()) { - return TriRpcStatus.Code.UNIMPLEMENTED; + return Code.UNIMPLEMENTED; } else if (httpStatusCode == HttpResponseStatus.BAD_GATEWAY.code() || httpStatusCode == HttpResponseStatus.TOO_MANY_REQUESTS.code() || httpStatusCode == HttpResponseStatus.SERVICE_UNAVAILABLE.code() || httpStatusCode == HttpResponseStatus.GATEWAY_TIMEOUT.code()) { return Code.UNAVAILABLE; } else { - return TriRpcStatus.Code.UNKNOWN; + return Code.UNKNOWN; } } diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/stub/StubInvocationUtil.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/stub/StubInvocationUtil.java similarity index 100% rename from dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/stub/StubInvocationUtil.java rename to dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/stub/StubInvocationUtil.java diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/StatusRpcExceptionTest.java b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/StatusRpcExceptionTest.java similarity index 100% rename from dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/StatusRpcExceptionTest.java rename to dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/StatusRpcExceptionTest.java diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/TriRpcStatusTest.java b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/TriRpcStatusTest.java similarity index 100% rename from dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/TriRpcStatusTest.java rename to dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/TriRpcStatusTest.java diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java similarity index 90% rename from dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java rename to dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java index e5196f3237..56a192c319 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/stub/StubInvocationUtilTest.java @@ -25,7 +25,7 @@ import org.apache.dubbo.rpc.Result; import org.apache.dubbo.rpc.model.ConsumerModel; import org.apache.dubbo.rpc.model.MethodDescriptor; import org.apache.dubbo.rpc.model.ServiceDescriptor; -import org.apache.dubbo.rpc.support.DemoService; +import org.apache.dubbo.rpc.protocol.tri.support.IGreeter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -43,7 +43,7 @@ class StubInvocationUtilTest { @Test void unaryCall() throws Throwable { - Invoker invoker = Mockito.mock(Invoker.class); + Invoker invoker = Mockito.mock(Invoker.class); URL url = Mockito.mock(URL.class); ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); @@ -51,13 +51,13 @@ class StubInvocationUtilTest { when(url.getServiceModel()) .thenReturn(consumerModel); when(url.getServiceInterface()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(url.getProtocolServiceKey()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(invoker.getUrl()) .thenReturn(url); when(invoker.getInterface()) - .thenReturn(DemoService.class); + .thenReturn(IGreeter.class); Result result = Mockito.mock(Result.class); when(invoker.invoke(any(Invocation.class))) .thenReturn(result); @@ -75,7 +75,7 @@ class StubInvocationUtilTest { @Test void unaryCall2() throws Throwable { - Invoker invoker = Mockito.mock(Invoker.class); + Invoker invoker = Mockito.mock(Invoker.class); URL url = Mockito.mock(URL.class); ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); @@ -83,13 +83,13 @@ class StubInvocationUtilTest { when(url.getServiceModel()) .thenReturn(consumerModel); when(url.getServiceInterface()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(url.getProtocolServiceKey()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(invoker.getUrl()) .thenReturn(url); when(invoker.getInterface()) - .thenReturn(DemoService.class); + .thenReturn(IGreeter.class); Result result = Mockito.mock(Result.class); when(invoker.invoke(any(Invocation.class))) .thenThrow(new RuntimeException("a")) @@ -118,7 +118,7 @@ class StubInvocationUtilTest { @Test void testUnaryCall() throws Throwable { - Invoker invoker = Mockito.mock(Invoker.class); + Invoker invoker = Mockito.mock(Invoker.class); URL url = Mockito.mock(URL.class); ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); @@ -126,13 +126,13 @@ class StubInvocationUtilTest { when(url.getServiceModel()) .thenReturn(consumerModel); when(url.getServiceInterface()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(url.getProtocolServiceKey()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(invoker.getUrl()) .thenReturn(url); when(invoker.getInterface()) - .thenReturn(DemoService.class); + .thenReturn(IGreeter.class); Result result = Mockito.mock(Result.class); String response = "response"; when(invoker.invoke(any(Invocation.class))) @@ -168,7 +168,7 @@ class StubInvocationUtilTest { @Test void biOrClientStreamCall() throws InterruptedException { - Invoker invoker = Mockito.mock(Invoker.class); + Invoker invoker = Mockito.mock(Invoker.class); URL url = Mockito.mock(URL.class); ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); @@ -176,13 +176,13 @@ class StubInvocationUtilTest { when(url.getServiceModel()) .thenReturn(consumerModel); when(url.getServiceInterface()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(url.getProtocolServiceKey()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(invoker.getUrl()) .thenReturn(url); when(invoker.getInterface()) - .thenReturn(DemoService.class); + .thenReturn(IGreeter.class); Result result = Mockito.mock(Result.class); String response = "response"; @@ -243,7 +243,7 @@ class StubInvocationUtilTest { @Test void serverStreamCall() throws InterruptedException { - Invoker invoker = Mockito.mock(Invoker.class); + Invoker invoker = Mockito.mock(Invoker.class); URL url = Mockito.mock(URL.class); ConsumerModel consumerModel = Mockito.mock(ConsumerModel.class); ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class); @@ -251,13 +251,13 @@ class StubInvocationUtilTest { when(url.getServiceModel()) .thenReturn(consumerModel); when(url.getServiceInterface()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(url.getProtocolServiceKey()) - .thenReturn(DemoService.class.getName()); + .thenReturn(IGreeter.class.getName()); when(invoker.getUrl()) .thenReturn(url); when(invoker.getInterface()) - .thenReturn(DemoService.class); + .thenReturn(IGreeter.class); Result result = Mockito.mock(Result.class); String response = "response"; when(invoker.invoke(any(Invocation.class)))