This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new c467ae75 Add test cases to verify apache/dubbo#13078 (#1005)
c467ae75 is described below

commit c467ae75753bce9160a4b4f383338512552bc593
Author: Albumen Kevin <[email protected]>
AuthorDate: Wed Nov 15 10:12:08 2023 +0800

    Add test cases to verify apache/dubbo#13078 (#1005)
    
    * Add test cases to verify apache/dubbo#13078
    
    * update
    
    * update port
    
    * Fix log
---
 .github/workflows/dubbo-3_2.yml                    |   3 +
 .github/workflows/dubbo-3_3.yml                    |   3 +
 .../case-configuration.yml                         |  23 +++++
 .../dubbo-samples-test-13078/case-versions.conf    |  24 +++++
 99-integration/dubbo-samples-test-13078/pom.xml    | 108 +++++++++++++++++++++
 .../apache/dubbo/samples/api/GreetingsService.java |  22 +++++
 .../apache/dubbo/samples/provider/Application.java |  44 +++++++++
 .../samples/provider/GreetingsServiceImpl.java     |  27 ++++++
 .../src/main/resources/log4j.properties            |  25 +++++
 .../src/main/resources/logback.xml                 |  30 ++++++
 .../dubbo/samples/client/GreetingServiceIT.java    |  74 ++++++++++++++
 .../dubbo/samples/client/WireProtocolWrapper.java  |  79 +++++++++++++++
 .../org.apache.dubbo.remoting.api.WireProtocol     |   1 +
 99-integration/pom.xml                             |   1 +
 14 files changed, 464 insertions(+)

diff --git a/.github/workflows/dubbo-3_2.yml b/.github/workflows/dubbo-3_2.yml
index 8bbb59f3..6c91df24 100644
--- a/.github/workflows/dubbo-3_2.yml
+++ b/.github/workflows/dubbo-3_2.yml
@@ -51,6 +51,9 @@ jobs:
       - name: Build with Maven
         run: |
           ./mvnw $BUILD_OPTS
+      - name: Clean with Maven
+        run: |
+          ./mvnw --batch-mode --no-snapshot-updates --no-transfer-progress 
--settings ${{github.workspace}}/.mvn/settings.xml clean
 
   build-dubbo:
     runs-on: ubuntu-latest
diff --git a/.github/workflows/dubbo-3_3.yml b/.github/workflows/dubbo-3_3.yml
index c6daccd2..177b6181 100644
--- a/.github/workflows/dubbo-3_3.yml
+++ b/.github/workflows/dubbo-3_3.yml
@@ -51,6 +51,9 @@ jobs:
       - name: Build with Maven
         run: |
           ./mvnw $BUILD_OPTS
+      - name: Clean with Maven
+        run: |
+          ./mvnw --batch-mode --no-snapshot-updates --no-transfer-progress 
--settings ${{github.workspace}}/.mvn/settings.xml clean
 
   build-dubbo:
     runs-on: ubuntu-latest
diff --git a/99-integration/dubbo-samples-test-13078/case-configuration.yml 
b/99-integration/dubbo-samples-test-13078/case-configuration.yml
new file mode 100644
index 00000000..a739955d
--- /dev/null
+++ b/99-integration/dubbo-samples-test-13078/case-configuration.yml
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+
+from: app-external-zookeeper.yml
+
+props:
+  project_name: dubbo-samples-test-13078
+  main_class: org.apache.dubbo.samples.provider.Application
+  dubbo_port: 50051
+  check_log: "DubboBootstrap awaiting ..."
diff --git a/99-integration/dubbo-samples-test-13078/case-versions.conf 
b/99-integration/dubbo-samples-test-13078/case-versions.conf
new file mode 100644
index 00000000..5610cf33
--- /dev/null
+++ b/99-integration/dubbo-samples-test-13078/case-versions.conf
@@ -0,0 +1,24 @@
+#
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   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.
+#
+
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=3.*
+java.version= [ >= 8 ]
\ No newline at end of file
diff --git a/99-integration/dubbo-samples-test-13078/pom.xml 
b/99-integration/dubbo-samples-test-13078/pom.xml
new file mode 100644
index 00000000..50181120
--- /dev/null
+++ b/99-integration/dubbo-samples-test-13078/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>23</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.apache.dubbo</groupId>
+    <version>1.0-SNAPSHOT</version>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dubbo-samples-test-13078</artifactId>
+    <name>Dubbo Samples Test for 13078</name>
+    <description>Dubbo Samples Test for 13078</description>
+
+    <properties>
+        <dubbo.version>3.2.8-SNAPSHOT</dubbo.version>
+        <junit5.version>5.9.2</junit5.version>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <slf4j-log4j12.version>1.7.33</slf4j-log4j12.version>
+        <awaitility.version>4.2.0</awaitility.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo</artifactId>
+            <version>${dubbo.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-dependencies-zookeeper-curator5</artifactId>
+            <version>${dubbo.version}</version>
+            <type>pom</type>
+            <exclusions>
+                <exclusion>
+                    <artifactId>logback-classic</artifactId>
+                    <groupId>ch.qos.logback</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>logback-core</artifactId>
+                    <groupId>ch.qos.logback</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j-log4j12.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.22.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <version>${awaitility.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <version>${junit5.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>${junit5.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-params</artifactId>
+            <version>${junit5.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git 
a/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
new file mode 100644
index 00000000..06b23567
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+
+package org.apache.dubbo.samples.api;
+
+public interface GreetingsService {
+    String sayHi(String name);
+}
diff --git 
a/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/Application.java
 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/Application.java
new file mode 100644
index 00000000..4d67dce3
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/Application.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+
+package org.apache.dubbo.samples.provider;
+
+import org.apache.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.config.ServiceConfig;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
+import org.apache.dubbo.samples.api.GreetingsService;
+
+public class Application {
+    private static final String ZOOKEEPER_HOST = 
System.getProperty("zookeeper.address", "127.0.0.1");
+    private static final String ZOOKEEPER_PORT = 
System.getProperty("zookeeper.port", "2181");
+    private static final String ZOOKEEPER_ADDRESS = "zookeeper://" + 
ZOOKEEPER_HOST + ":" + ZOOKEEPER_PORT;
+
+    public static void main(String[] args) {
+        ServiceConfig<GreetingsService> service = new ServiceConfig<>();
+        service.setInterface(GreetingsService.class);
+        service.setRef(new GreetingsServiceImpl());
+
+        DubboBootstrap.getInstance()
+                .application("first-dubbo-provider")
+                .registry(new RegistryConfig(ZOOKEEPER_ADDRESS))
+                .protocol(new ProtocolConfig("tri", -1))
+                .service(service)
+                .start()
+                .await();
+    }
+}
diff --git 
a/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/GreetingsServiceImpl.java
 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/GreetingsServiceImpl.java
new file mode 100644
index 00000000..d0d44484
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/main/java/org/apache/dubbo/samples/provider/GreetingsServiceImpl.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+
+package org.apache.dubbo.samples.provider;
+
+import org.apache.dubbo.samples.api.GreetingsService;
+
+public class GreetingsServiceImpl implements GreetingsService {
+    @Override
+    public String sayHi(String name) {
+        return "hi, " + name;
+    }
+}
diff --git 
a/99-integration/dubbo-samples-test-13078/src/main/resources/log4j.properties 
b/99-integration/dubbo-samples-test-13078/src/main/resources/log4j.properties
new file mode 100644
index 00000000..e976f5c2
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/main/resources/log4j.properties
@@ -0,0 +1,25 @@
+#
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#  
+#       http://www.apache.org/licenses/LICENSE-2.0
+#  
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   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.
+#  
+#
+###set log levels###
+log4j.rootLogger=info, stdout
+###output to the console###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy hh:mm:ss:sss z}] 
%t %5p %c{2}: %m%n
\ No newline at end of file
diff --git 
a/99-integration/dubbo-samples-test-13078/src/main/resources/logback.xml 
b/99-integration/dubbo-samples-test-13078/src/main/resources/logback.xml
new file mode 100644
index 00000000..39fae26e
--- /dev/null
+++ b/99-integration/dubbo-samples-test-13078/src/main/resources/logback.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~
+  ~   Licensed to the Apache Software Foundation (ASF) under one or more
+  ~   contributor license agreements.  See the NOTICE file distributed with
+  ~   this work for additional information regarding copyright ownership.
+  ~   The ASF licenses this file to You under the Apache License, Version 2.0
+  ~   (the "License"); you may not use this file except in compliance with
+  ~   the License.  You may obtain a copy of the License at
+  ~
+  ~       http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   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.
+  ~
+  -->
+<configuration>
+       <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+          <encoder>
+             <pattern>%-4relative [%thread] %-5level %logger{35} - %msg 
%n</pattern>
+          </encoder>
+       </appender>
+
+       <root level="INFO">
+          <appender-ref ref="STDOUT" />
+       </root>
+</configuration>
diff --git 
a/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
 
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
new file mode 100644
index 00000000..8ac4b517
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+
+package org.apache.dubbo.samples.client;
+
+import org.apache.dubbo.config.ApplicationConfig;
+import org.apache.dubbo.config.ReferenceConfig;
+import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.rpc.RpcException;
+import org.apache.dubbo.samples.api.GreetingsService;
+
+import io.netty.handler.codec.http2.Http2Connection;
+import io.netty.handler.codec.http2.Http2LocalFlowController;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import static org.awaitility.Awaitility.await;
+
+public class GreetingServiceIT {
+    private static String zookeeperHost = 
System.getProperty("zookeeper.address", "127.0.0.1");
+
+    @Test
+    public void test() {
+        ReferenceConfig<GreetingsService> reference = new ReferenceConfig<>();
+        reference.setApplication(new 
ApplicationConfig("first-dubbo-consumer"));
+        reference.setRegistry(new RegistryConfig("zookeeper://" + 
zookeeperHost + ":2181"));
+        reference.setInterface(GreetingsService.class);
+        GreetingsService service = reference.get();
+
+        for (int i = 0; i < 100; i++) {
+            String message = service.sayHi("dubbo");
+            Assertions.assertEquals("hi, dubbo", message);
+        }
+
+        List<Http2Connection.Endpoint<Http2LocalFlowController>> endpoints = 
WireProtocolWrapper.getEndpoints();
+        Assertions.assertEquals(1, endpoints.size());
+        Http2Connection.Endpoint<Http2LocalFlowController> endpoint = 
endpoints.get(0);
+        while (endpoint.incrementAndGetNextStreamId() > 0) {
+            endpoint.incrementAndGetNextStreamId();
+        }
+
+        try {
+            service.sayHi("dubbo");
+            Assertions.fail();
+        } catch (RpcException e) {
+            Assertions.assertEquals("java.util.concurrent.ExecutionException: 
org.apache.dubbo.rpc.StatusRpcException: INTERNAL : Http2 exception", 
e.getMessage());
+        }
+
+        await().atMost(60, TimeUnit.SECONDS).untilAsserted(
+                () -> Assertions.assertEquals(2, endpoints.size()));
+
+        for (int i = 0; i < 100; i++) {
+            String message = service.sayHi("dubbo");
+            Assertions.assertEquals("hi, dubbo", message);
+        }
+    }
+}
diff --git 
a/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/WireProtocolWrapper.java
 
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/WireProtocolWrapper.java
new file mode 100644
index 00000000..afda5e45
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/WireProtocolWrapper.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.dubbo.samples.client;
+
+import org.apache.dubbo.common.URL;
+import org.apache.dubbo.remoting.api.ProtocolDetector;
+import org.apache.dubbo.remoting.api.WireProtocol;
+import org.apache.dubbo.remoting.api.pu.ChannelOperator;
+import org.apache.dubbo.remoting.api.ssl.ContextOperator;
+
+import io.netty.channel.Channel;
+import io.netty.handler.codec.http2.Http2Connection;
+import io.netty.handler.codec.http2.Http2FrameCodec;
+import io.netty.handler.codec.http2.Http2LocalFlowController;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class WireProtocolWrapper implements WireProtocol {
+    private final WireProtocol wireProtocol;
+    private final static 
List<Http2Connection.Endpoint<Http2LocalFlowController>> endpoints = new 
CopyOnWriteArrayList<>();
+
+    public WireProtocolWrapper(WireProtocol wireProtocol) {
+        this.wireProtocol = wireProtocol;
+    }
+
+    @Override
+    public ProtocolDetector detector() {
+        return wireProtocol.detector();
+    }
+
+    @Override
+    public void configServerProtocolHandler(URL url, ChannelOperator operator) 
{
+        wireProtocol.configServerProtocolHandler(url, operator);
+    }
+
+    @Override
+    public void configClientPipeline(URL url, ChannelOperator operator, 
ContextOperator contextOperator) {
+        wireProtocol.configClientPipeline(url, operator, contextOperator);
+        try {
+            Field channelField = 
operator.getClass().getDeclaredField("channel");
+            channelField.setAccessible(true);
+            Object dubboChannel = channelField.get(operator);
+            Method getNioChannelMethod = 
dubboChannel.getClass().getDeclaredMethod("getNioChannel");
+            getNioChannelMethod.setAccessible(true);
+            Channel channel = 
(Channel)getNioChannelMethod.invoke(dubboChannel);
+            Http2FrameCodec http2FrameCodec = 
channel.pipeline().get(Http2FrameCodec.class);
+            Http2Connection.Endpoint<Http2LocalFlowController> endpoint = 
http2FrameCodec.connection().local();
+            endpoints.add(endpoint);
+        } catch (Throwable t) {
+            t.printStackTrace();
+        }
+    }
+
+    @Override
+    public void close() {
+        wireProtocol.close();
+    }
+
+    public static List<Http2Connection.Endpoint<Http2LocalFlowController>> 
getEndpoints() {
+        return endpoints;
+    }
+}
diff --git 
a/99-integration/dubbo-samples-test-13078/src/test/resources/META-INF/dubbo/org.apache.dubbo.remoting.api.WireProtocol
 
b/99-integration/dubbo-samples-test-13078/src/test/resources/META-INF/dubbo/org.apache.dubbo.remoting.api.WireProtocol
new file mode 100644
index 00000000..e53dab79
--- /dev/null
+++ 
b/99-integration/dubbo-samples-test-13078/src/test/resources/META-INF/dubbo/org.apache.dubbo.remoting.api.WireProtocol
@@ -0,0 +1 @@
+wire-wrap=org.apache.dubbo.samples.client.WireProtocolWrapper
diff --git a/99-integration/pom.xml b/99-integration/pom.xml
index 3251b724..c4391a15 100644
--- a/99-integration/pom.xml
+++ b/99-integration/pom.xml
@@ -67,6 +67,7 @@
         <module>dubbo-samples-test-12376</module>
         <module>dubbo-samples-test-12631</module>
         <module>dubbo-samples-test-12697</module>
+        <module>dubbo-samples-test-13078</module>
         <module>dubbo-samples-test-13133</module>
         <module>dubbo-samples-test-abc-async</module>
         <module>dubbo-samples-test-register</module>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to