You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/04/08 09:57:13 UTC

[GitHub] [skywalking-java] hutaishi opened a new pull request, #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

hutaishi opened a new pull request, #147:
URL: https://github.com/apache/skywalking-java/pull/147

   Add skywaliking plugin for support Apache ShenYu (incubating) gateway.
   
   - [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
   
   ### topology
   ![image](https://user-images.githubusercontent.com/12478263/162412582-45a6d6c8-a982-4543-93a2-57e1e7cc6975.png)
   
   ### trace
   ![image](https://user-images.githubusercontent.com/12478263/162412738-3f1d566d-c6d8-49a7-9f2e-dfbe2a595d53.png)
   
   ### service provider exception
   ![image](https://user-images.githubusercontent.com/12478263/162412887-33bd72f9-9b8f-4e81-a55b-0537f83f7f36.png)
   ![image](https://user-images.githubusercontent.com/12478263/162412906-b799269d-3375-48d9-9fc1-ef9916659992.png)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846641077


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   If I implement a whitelist method(witnessClasses()), can I avoid interfering with other plugins?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1094259924

   I rerun all, let's see.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846717943


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   https://github.com/apache/skywalking-java/pull/147#discussion_r846691996 is about this one. This ia Shenyu(127) entry span, but it doesn't include a ref(cross process).
   
   I think in `client http request -> ShenYu gateway(route to provider) -> shenyu-http(service provider)` chain,  `client http request -> ShenYu gateway` is not verified whether Shenyu's plugin could process the incoming call properly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846751985


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   Do you mean the following?
   client http request ->  serviceA ->  gateway -> serviceB?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846716899


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http

Review Comment:
   The current calling relationship is as follows:
   client http request -> ShenYu gateway(route to provider) -> shenyu-http(service provider)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846720881


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/shenyu-rule.json:
##########
@@ -0,0 +1,347 @@
+/**
+#
+# 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.
+#
+*/
+{
+  "1512230008264994816": [
+    {
+      "id": "1512230008290160640",

Review Comment:
   this is exported.  but now I have replace them with 1,2.  and deleted unnecessary and simplified configuration



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846609504


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/pom.xml:
##########
@@ -0,0 +1,91 @@
+<?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>
+        <artifactId>shenyu-2.4.x-scenario</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>shenyu-gateway</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-spring-boot-starter-gateway</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>shenyu-gateway</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-snapshots</id>
+            <url>https://repo.spring.io/snapshot</url>
+        </pluginRepository>
+        <pluginRepository>
+            <id>spring-milestones</id>
+            <url>https://repo.spring.io/milestone</url>
+        </pluginRepository>
+    </pluginRepositories>

Review Comment:
   There should not be added, unless you have special reasons.



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/java/test/apache/skywalking/apm/testcase/shenyu/gateway/init/InitRouterRunner.java:
##########
@@ -0,0 +1,285 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.shenyu.gateway.init;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.plugin.base.cache.BaseDataCache;
+import org.apache.shenyu.sync.data.api.PluginDataSubscriber;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * init gateway router runner.
+ */
+@Slf4j
+@Component
+public class InitRouterRunner implements CommandLineRunner {
+
+    @Autowired
+    private PluginDataSubscriber subscriber;
+
+    @Override
+    public void run(String... args) throws Exception {
+        String pluginData = "{\"request\":{\"id\":\"20\",\"name\":\"request\",\"config\":null,"

Review Comment:
   Please move this to file, it would be better to maintain and read by others.



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/application.yml:
##########
@@ -0,0 +1,233 @@
+#
+# 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.
+#
+
+server:
+  port: 9195
+  address: 0.0.0.0
+
+spring:
+  main:
+    allow-bean-definition-overriding: true
+  application:
+    name: shenyu-gateway
+  codec:
+    max-in-memory-size: 2MB
+  cloud:
+    loadbalancer:
+      ribbon:
+        enabled: false
+    discovery:
+      enabled: false
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848 # Spring Cloud Alibaba Dubbo use this.
+        enabled: false
+        namespace: ShenyuRegisterCenter
+
+eureka:
+  client:
+    enabled: true
+    serviceUrl:
+      defaultZone: http://localhost:8761/eureka/
+    register-with-eureka: true
+    fetch-registry: true
+  instance:
+    prefer-ip-address: true
+
+#  security:

Review Comment:
   Too many comments, please minimal your codes and configurations.



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/java/test/apache/skywalking/apm/testcase/shenyu/gateway/init/InitRouterRunner.java:
##########
@@ -0,0 +1,285 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.shenyu.gateway.init;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.plugin.base.cache.BaseDataCache;
+import org.apache.shenyu.sync.data.api.PluginDataSubscriber;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * init gateway router runner.
+ */
+@Slf4j
+@Component
+public class InitRouterRunner implements CommandLineRunner {
+
+    @Autowired
+    private PluginDataSubscriber subscriber;
+
+    @Override
+    public void run(String... args) throws Exception {
+        String pluginData = "{\"request\":{\"id\":\"20\",\"name\":\"request\",\"config\":null,"
+                + "\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":120},\"jwt\":{\"id\":\"19\",\"name\":\"jwt\","
+                + "\"config\":\"{\\\"secretKey\\\":\\\"key\\\"}\",\"role\":\"Authentication\",\"enabled\":false,"
+                + "\"sort\":30},\"paramMapping\":{\"id\":\"22\",\"name\":\"paramMapping\","
+                + "\"config\":\"{\\\"ruleHandlePageType\\\":\\\"custom\\\"}\",\"role\":\"HttpProcess\","
+                + "\"enabled\":false,\"sort\":70},\"modifyResponse\":{\"id\":\"23\",\"name\":\"modifyResponse\","
+                + "\"config\":\"{\\\"ruleHandlePageType\\\":\\\"custom\\\"}\",\"role\":\"HttpProcess\","
+                + "\"enabled\":false,\"sort\":220},\"sign\":{\"id\":\"1\",\"name\":\"sign\",\"config\":null,"
+                + "\"role\":\"Authentication\",\"enabled\":false,\"sort\":20},\"dubbo\":{\"id\":\"6\","
+                + "\"name\":\"dubbo\",\"config\":\"{\\\"register\\\":\\\"zookeeper://localhost:2181\\\","
+                + "\\\"multiSelectorHandle\\\":\\\"1\\\",\\\"threadpool\\\":\\\"cached\\\",\\\"corethreads\\\":0,"
+                + "\\\"threads\\\":2147483647,\\\"queues\\\":0}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},"
+                + "\"motan\":{\"id\":\"17\",\"name\":\"motan\",\"config\":\"{\\\"register\\\":\\\"127.0.0"
+                + ".1:2181\\\"}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"oauth2\":{\"id\":\"21\","
+                + "\"name\":\"oauth2\",\"config\":null,\"role\":\"Authentication\",\"enabled\":false,\"sort\":40},"
+                + "\"rateLimiter\":{\"id\":\"4\",\"name\":\"rateLimiter\","
+                + "\"config\":\"{\\\"master\\\":\\\"mymaster\\\",\\\"mode\\\":\\\"standalone\\\",\\\"url\\\":\\\"192"
+                + ".168.1.1:6379\\\",\\\"password\\\":\\\"abc\\\"}\",\"role\":\"FaultTolerance\",\"enabled\":false,"
+                + "\"sort\":60},\"websocket\":{\"id\":\"26\",\"name\":\"websocket\","
+                + "\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\"}\",\"role\":\"Proxy\",\"enabled\":true,"
+                + "\"sort\":200},\"mqtt\":{\"id\":\"28\",\"name\":\"mqtt\",\"config\":\"{\\\"port\\\": 9500,"
+                + "\\\"bossGroupThreadCount\\\": 1,\\\"maxPayloadSize\\\": 65536,\\\"workerGroupThreadCount\\\": 12,"
+                + "\\\"userName\\\": \\\"shenyu\\\",\\\"password\\\": \\\"shenyu\\\",\\\"isEncryptPassword\\\": "
+                + "false,\\\"encryptMode\\\": \\\"\\\",\\\"leakDetectorLevel\\\": \\\"DISABLED\\\"}\","
+                + "\"role\":\"Proxy\",\"enabled\":false,\"sort\":125},\"tars\":{\"id\":\"13\",\"name\":\"tars "
+                + "tested\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\",\\\"multiRuleHandle\\\":\\\"0\\\"}\","
+                + "\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"cryptorRequest\":{\"id\":\"24\","
+                + "\"name\":\"cryptorRequest\",\"config\":null,\"role\":\"Cryptor\",\"enabled\":true,\"sort\":100},"
+                + "\"divide\":{\"id\":\"5\",\"name\":\"divide\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\","
+                + "\\\"multiRuleHandle\\\":\\\"0\\\"}\",\"role\":\"Proxy\",\"enabled\":true,\"sort\":200},"
+                + "\"waf\":{\"id\":\"2\",\"name\":\"waf\",\"config\":\"{\\\"model\\\":\\\"black\\\"}\","
+                + "\"role\":\"Authentication\",\"enabled\":false,\"sort\":50},\"redirect\":{\"id\":\"16\","
+                + "\"name\":\"redirect\",\"config\":null,\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":110},"
+                + "\"sentinel\":{\"id\":\"10\",\"name\":\"sentinel\",\"config\":null,\"role\":\"FaultTolerance\","
+                + "\"enabled\":false,\"sort\":140},\"hystrix\":{\"id\":\"9\",\"name\":\"hystrix\",\"config\":null,"
+                + "\"role\":\"FaultTolerance\",\"enabled\":false,\"sort\":130},\"sofa\":{\"id\":\"11\","
+                + "\"name\":\"sofa\",\"config\":\"{\\\"protocol\\\":\\\"zookeeper\\\",\\\"register\\\":\\\"127.0.0"
+                + ".1:2181\\\"}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"cache\":{\"id\":\"30\","
+                + "\"name\":\"cache\",\"config\":\"{\\\"cacheType\\\":\\\"memory\\\"}\",\"role\":\"Cache\","
+                + "\"enabled\":false,\"sort\":10},\"contextPath\":{\"id\":\"14\",\"name\":\"contextPath\","
+                + "\"config\":null,\"role\":\"HttpProcess\",\"enabled\":true,\"sort\":80},"
+                + "\"generalContext\":{\"id\":\"27\",\"name\":\"generalContext\",\"config\":null,\"role\":\"Common\","
+                + "\"enabled\":true,\"sort\":125},\"rewrite\":{\"id\":\"3\",\"name\":\"rewrite\",\"config\":null,"
+                + "\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":90},\"springCloud\":{\"id\":\"8\","
+                + "\"name\":\"springCloud\",\"config\":null,\"role\":\"Proxy\",\"enabled\":false,\"sort\":200},"
+                + "\"grpc\":{\"id\":\"15\",\"name\":\"grpc\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\","
+                + "\\\"multiRuleHandle\\\":\\\"0\\\",\\\"threadpool\\\":\\\"cached\\\"}\",\"role\":\"Proxy\","
+                + "\"enabled\":false,\"sort\":310},\"resilience4j\":{\"id\":\"12\",\"name\":\"resilience4j\","
+                + "\"config\":null,\"role\":\"FaultTolerance\",\"enabled\":false,\"sort\":310},"
+                + "\"logging\":{\"id\":\"18\",\"name\":\"logging\",\"config\":null,\"role\":\"Logging\","
+                + "\"enabled\":false,\"sort\":160},\"cryptorResponse\":{\"id\":\"25\",\"name\":\"cryptorResponse\","
+                + "\"config\":null,\"role\":\"Cryptor\",\"enabled\":true,\"sort\":410},"
+                + "\"loggingRocketMQ\":{\"id\":\"29\",\"name\":\"loggingRocketMQ\","
+                + "\"config\":\"{\\\"topic\\\":\\\"shenyu-access-logging\\\", \\\"namesrvAddr\\\": "
+                + "\\\"localhost:9876\\\",\\\"producerGroup\\\":\\\"shenyu-plugin-logging-rocketmq\\\"}\","
+                + "\"role\":\"Logging\",\"enabled\":false,\"sort\":170}}";
+
+        String selectorData = "{\"contextPath\":[{\"id\":\"1512230008264994816\",\"pluginId\":\"14\","
+                + "\"pluginName\":\"contextPath\",\"name\":\"/http\",\"matchMode\":0,\"type\":1,\"sort\":1,"
+                + "\"enabled\":true,\"logged\":true,\"continued\":true,\"handle\":null,"
+                + "\"conditionList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/**\"}]}],\"divide\":[{\"id\":\"1512230008105611264\",\"pluginId\":\"5\","
+                + "\"pluginName\":\"divide\",\"name\":\"/http\",\"matchMode\":0,\"type\":1,\"sort\":1,"
+                + "\"enabled\":true,\"logged\":true,\"continued\":true,\"handle\":\"[{\\\"weight\\\":50,"
+                + "\\\"warmup\\\":10,\\\"protocol\\\":\\\"http://\\\",\\\"upstreamHost\\\":\\\"localhost\\\","
+                + "\\\"upstreamUrl\\\":\\\"localhost:8189\\\",\\\"status\\\":true,"
+                + "\\\"timestamp\\\":1649378707380}]\",\"conditionList\":[{\"paramType\":\"uri\","
+                + "\"operator\":\"match\",\"paramName\":\"/\",\"paramValue\":\"/http/**\"}]}]}\n";
+
+        String ruleData = "{\"1512230008264994816\":[{\"id\":\"1512230008290160640\",\"name\":\"/http\","
+                + "\"pluginName\":\"contextPath\",\"selectorId\":\"1512230008264994816\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"contextPath\\\":\\\"/http\\\"}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/**\"}]}],\"1512230008105611264\":[{\"id\":\"1512230008223051776\","
+                + "\"name\":\"/http/order/path/**/name\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/path/**/name\"}]},{\"id\":\"1512230008755728384\","
+                + "\"name\":\"/http/order\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order\"}]},{\"id\":\"1512230009120632832\",\"name\":\"/http/order/save\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/save\"}]},{\"id\":\"1512230009321959424\","
+                + "\"name\":\"/http/order/path/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/path/**\"}]},{\"id\":\"1512230009363902464\","
+                + "\"name\":\"/http/order/oauth2/test\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/oauth2/test\"}]},{\"id\":\"1512230009397456896\","
+                + "\"name\":\"/http/test/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/test/**\"}]},{\"id\":\"1512230009481342976\","
+                + "\"name\":\"/http/order/findById\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/findById\"}]},{\"id\":\"1512230009514897408\",\"name\":\"/http/\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/\"}]},{\"id\":\"1512230009586200576\",\"name\":\"/http/post/hi\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/post/hi\"}]},{\"id\":\"1512230009607172096\","
+                + "\"name\":\"/http/shenyu/client/hi\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/hi\"}]},{\"id\":\"1512230009632337920\","
+                + "\"name\":\"/http/shenyu/client/timeout\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/timeout\"}]},{\"id\":\"1512230009712029696\","
+                + "\"name\":\"/http/shenyu/client/hello\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/hello\"}]},{\"id\":\"1512230009728806912\","
+                + "\"name\":\"/http/request/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/request/**\"}]},{\"id\":\"1512230009787527168\",\"name\":\"/http/hello\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/hello\"}]},{\"id\":\"1512230009804304384\","
+                + "\"name\":\"/http/shenyu/client/post/hi\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/post/hi\"}]},{\"id\":\"1512230009955299328\","
+                + "\"name\":\"/http/hi\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/hi\"}]}]}";
+
+        Map<String, PluginData> pluginDataMap = GsonUtils.getInstance().toObjectMap(pluginData, PluginData.class);
+        Map<String, List<SelectorData>> selectorDataMap = GsonUtils.getInstance().toObjectMapList(selectorData, SelectorData.class);
+        Map<String, List<RuleData>> ruleDataMap = GsonUtils.getInstance().toObjectMapList(ruleData, RuleData.class);
+
+
+
+
+        BaseDataCache dataCache = BaseDataCache.getInstance();
+        pluginDataMap.values().forEach(subscriber::onSubscribe);
+        selectorDataMap.values().stream().flatMap(Collection::stream).forEach(data -> {
+
+            subscriber.onSelectorSubscribe(data);
+            // dataCache.cacheSelectData(data);
+            // DividePluginDataHandler.handlerSelector(data);
+
+        });
+        ruleDataMap.values().stream().flatMap(Collection::stream).forEach(subscriber::onRuleSubscribe);
+
+        // String contextData = "{\"cached\":{\"1512230008264994816_/http\":{\"contextPath\":\"/http\"}}}";

Review Comment:
   Commented codes should be removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1094041019

   Please make sure you have run all tasks locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846645218


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   What do you mean `can't`? You just need to add a document to say, please activate this optional plugin. Nothing more.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846765933


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   The test module has been adjusted.
   ![image](https://user-images.githubusercontent.com/12478263/162616341-ccbfa62f-199e-46de-b268-b79090e7209e.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846620880


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/application.yml:
##########
@@ -0,0 +1,233 @@
+#
+# 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.
+#
+
+server:
+  port: 9195
+  address: 0.0.0.0
+
+spring:
+  main:
+    allow-bean-definition-overriding: true
+  application:
+    name: shenyu-gateway
+  codec:
+    max-in-memory-size: 2MB
+  cloud:
+    loadbalancer:
+      ribbon:
+        enabled: false
+    discovery:
+      enabled: false
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848 # Spring Cloud Alibaba Dubbo use this.
+        enabled: false
+        namespace: ShenyuRegisterCenter
+
+eureka:
+  client:
+    enabled: true
+    serviceUrl:
+      defaultZone: http://localhost:8761/eureka/
+    register-with-eureka: true
+    fetch-registry: true
+  instance:
+    prefer-ip-address: true
+
+#  security:

Review Comment:
   thinks. now only 5 lines.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846649662


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   It has been modified according to this good practice, and the local integration test has passed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846752395


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   Thank you. I'll adjust it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1093849479

   Once you confirmed you could pass tests locally, I could approve to run yours on GHA.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846647023


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   I got. This is a good practice. Let me reconstruct it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1093960567

   CI fails before the plugin test begins.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846632928


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/ServerWebExchangeConstructorInterceptor.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+/**
+ * ServerWebExchange Constructor Interceptor.
+ */
+public class ServerWebExchangeConstructorInterceptor implements InstanceConstructorInterceptor {

Review Comment:
   This interceptor seems to do nothing, what is your plan for doing this? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846717609


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/shenyu-rule.json:
##########
@@ -0,0 +1,347 @@
+/**
+#
+# 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.
+#
+*/
+{
+  "1512230008264994816": [
+    {
+      "id": "1512230008290160640",

Review Comment:
   Would you replace them with `1,2,3` with comments to say this is just an ID for Shenyu setup? Or is this exported so it is like this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846620716


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/pom.xml:
##########
@@ -0,0 +1,91 @@
+<?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>
+        <artifactId>shenyu-2.4.x-scenario</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>shenyu-gateway</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-spring-boot-starter-gateway</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>${lombok.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>shenyu-gateway</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-snapshots</id>
+            <url>https://repo.spring.io/snapshot</url>
+        </pluginRepository>
+        <pluginRepository>
+            <id>spring-milestones</id>
+            <url>https://repo.spring.io/milestone</url>
+        </pluginRepository>
+    </pluginRepositories>

Review Comment:
   thinks. I have removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846713633


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/GlobalPluginExecuteMethodInterceptor.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags.HTTP;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.web.server.ServerWebExchangeDecorator;
+import org.springframework.web.server.adapter.DefaultServerWebExchange;
+
+import reactor.core.publisher.Mono;
+
+/**
+ * apache global plugin interceptor.

Review Comment:
   Thank you. It has been fixed.



##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/GlobalPluginExecuteMethodInterceptor.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags.HTTP;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.web.server.ServerWebExchangeDecorator;
+import org.springframework.web.server.adapter.DefaultServerWebExchange;
+
+import reactor.core.publisher.Mono;
+
+/**
+ * apache global plugin interceptor.
+ */
+public class GlobalPluginExecuteMethodInterceptor implements InstanceMethodsAroundInterceptor {
+
+    public static final String SHENYU_AGENT_TRACE_ID = "shenyu-agent-trace-id";
+
+    @Override
+    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
+            MethodInterceptResult result) throws Throwable {
+        EnhancedInstance instance = getInstance(allArguments[0]);
+        ServerWebExchange exchange = (ServerWebExchange) allArguments[0];
+
+        ContextCarrier carrier = new ContextCarrier();
+        CarrierItem next = carrier.items();
+        HttpHeaders headers = exchange.getRequest().getHeaders();
+        while (next.hasNext()) {
+            next = next.next();
+            List<String> header = headers.get(next.getHeadKey());
+            if (header != null && header.size() > 0) {
+                next.setHeadValue(header.get(0));
+            }
+        }
+
+        AbstractSpan span = ContextManager.createEntrySpan(exchange.getRequest().getURI().getPath(), carrier);
+        if (instance != null && instance.getSkyWalkingDynamicField() != null) {
+            ContextManager.continued((ContextSnapshot) objInst.getSkyWalkingDynamicField());

Review Comment:
   Thank you. It has been removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846713797


##########
docs/en/setup/service-agent/java-agent/Supported-list.md:
##########
@@ -31,6 +31,7 @@ metrics based on the tracing data.
   * JRE HttpURLConnection (Optional²)
 * HTTP Gateway
   * [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway) 2.0.2.RELEASE -> 3.x (Optional²)
+  * [Apache ShenYu](https://shenyu.apache.org) 2.4.x

Review Comment:
   good idea. It has been remove to optional plugin folder. thinks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846713675


##########
docs/en/setup/service-agent/java-agent/Plugin-list.md:
##########
@@ -136,3 +136,4 @@
 - undertow-worker-thread-pool
 - tomcat-thread-pool
 - guava-eventbus
+- shenyu-2.4.x (Please must active optional spring-webflux-5.x-plugin plugin when you install agent in shenyu)

Review Comment:
   Thank you. It has been fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846766142


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   Local integration test passed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846694667


##########
docs/en/setup/service-agent/java-agent/Supported-list.md:
##########
@@ -31,6 +31,7 @@ metrics based on the tracing data.
   * JRE HttpURLConnection (Optional²)
 * HTTP Gateway
   * [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway) 2.0.2.RELEASE -> 3.x (Optional²)
+  * [Apache ShenYu](https://shenyu.apache.org) 2.4.x

Review Comment:
   Notice `ServerWebExchangeInstrumentation` in gateway-3.x plugin, as well as its shade in pom.xml. It shades the webflux plugin and add a witness class.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1094259706

   2 failing:
   `CI / Java 8 / macos (pull_request) Failing after 4m — Java 8 / macos`
   `Test / jdk-threading-scenario (pull_request) Failing after 1m — jdk-threading-scenario`
   
   but `Test / shenyu-2.4.x-scenario (pull_request)` is ok.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r845955453


##########
apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java:
##########
@@ -220,4 +220,6 @@
     public static final OfficialComponent APACHE_KYLIN_JDBC_DRIVER = new OfficialComponent(121, "apache-kylin-jdbc-driver");
 
     public static final OfficialComponent GUAVA_EVENT_BUS = new OfficialComponent(123, "GuavaEventBus");
+
+    public static final OfficialComponent APACHE_SHENYU = new OfficialComponent(124, "Apache-ShenYu");

Review Comment:
   New component need another two updates, one is in the backend/main repo, the other is in the booster UI repo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846691841


##########
docs/en/setup/service-agent/java-agent/Supported-list.md:
##########
@@ -31,6 +31,7 @@ metrics based on the tracing data.
   * JRE HttpURLConnection (Optional²)
 * HTTP Gateway
   * [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway) 2.0.2.RELEASE -> 3.x (Optional²)
+  * [Apache ShenYu](https://shenyu.apache.org) 2.4.x

Review Comment:
   Consider move this whole plugin into optional? Like Apring Gateway.
   
   And update optional-plugins doc ref to Spring gateway.
   
   > Plugin of Spring Cloud Gateway 2.1.x in optional plugin folder. Please only active this plugin when you install agent in Spring Gateway. spring-cloud-gateway-2.x-plugin and spring-webflux-5.x-plugin are both required.
   
   This should be more clear.
   If you want the agent out of out for your users, consider to distribute our agent in your binary tar, Seata and DolphinScheduler did this, and activate your required plugin only.



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http

Review Comment:
   You should consider exposing this as test entry, and there is a new endpoint calling Gateway, and Gateway routes back to here.
   
   Then we could verify whether Gateway process incoming context coreectly.



##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/GlobalPluginExecuteMethodInterceptor.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags.HTTP;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.web.server.ServerWebExchangeDecorator;
+import org.springframework.web.server.adapter.DefaultServerWebExchange;
+
+import reactor.core.publisher.Mono;
+
+/**
+ * apache global plugin interceptor.
+ */
+public class GlobalPluginExecuteMethodInterceptor implements InstanceMethodsAroundInterceptor {
+
+    public static final String SHENYU_AGENT_TRACE_ID = "shenyu-agent-trace-id";
+
+    @Override
+    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
+            MethodInterceptResult result) throws Throwable {
+        EnhancedInstance instance = getInstance(allArguments[0]);
+        ServerWebExchange exchange = (ServerWebExchange) allArguments[0];
+
+        ContextCarrier carrier = new ContextCarrier();
+        CarrierItem next = carrier.items();
+        HttpHeaders headers = exchange.getRequest().getHeaders();
+        while (next.hasNext()) {
+            next = next.next();
+            List<String> header = headers.get(next.getHeadKey());
+            if (header != null && header.size() > 0) {
+                next.setHeadValue(header.get(0));
+            }
+        }
+
+        AbstractSpan span = ContextManager.createEntrySpan(exchange.getRequest().getURI().getPath(), carrier);
+        if (instance != null && instance.getSkyWalkingDynamicField() != null) {
+            ContextManager.continued((ContextSnapshot) objInst.getSkyWalkingDynamicField());

Review Comment:
   An entry span has a cross thread ref? What is this case?



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/shenyu-rule.json:
##########
@@ -0,0 +1,347 @@
+/**
+#
+# 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.
+#
+*/
+{
+  "1512230008264994816": [
+    {
+      "id": "1512230008290160640",

Review Comment:
   What IDs are these? 



##########
docs/en/setup/service-agent/java-agent/Plugin-list.md:
##########
@@ -136,3 +136,4 @@
 - undertow-worker-thread-pool
 - tomcat-thread-pool
 - guava-eventbus
+- shenyu-2.4.x (Please must active optional spring-webflux-5.x-plugin plugin when you install agent in shenyu)

Review Comment:
   This file is used for CI check, please don't add comments, it must match the key in plugin.def file.



##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/GlobalPluginExecuteMethodInterceptor.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Objects;
+
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags.HTTP;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ServerWebExchange;
+import org.springframework.web.server.ServerWebExchangeDecorator;
+import org.springframework.web.server.adapter.DefaultServerWebExchange;
+
+import reactor.core.publisher.Mono;
+
+/**
+ * apache global plugin interceptor.

Review Comment:
   I think you miss something, this comment is not correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846645248


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   Spring gateway is working in this way, you could find it in the document.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846620662


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/bin/startup.sh:
##########
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# 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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/shenyu-2.4.x-scenario.jar &

Review Comment:
   Thank you. I've fixed it



##########
test/plugin/scenarios/shenyu-2.4.x-scenario/support-version.list:
##########
@@ -0,0 +1,17 @@
+# 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.
+
+# lists your version here (Contains only the last version number of each minor version.)

Review Comment:
   Thank you. I've fixed it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846633378


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/ServerWebExchangeConstructorInterceptor.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+/**
+ * ServerWebExchange Constructor Interceptor.
+ */
+public class ServerWebExchangeConstructorInterceptor implements InstanceConstructorInterceptor {

Review Comment:
   setSkyWalkingDynamicField(snapshot);
   Later plugins can continue this snapshot when another thread executes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r845958234


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/support-version.list:
##########
@@ -0,0 +1,17 @@
+# 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.
+
+# lists your version here (Contains only the last version number of each minor version.)

Review Comment:
   No version here, I think the test wouldn't be activated, please run test locally.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846644800


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   I've considered relying on apm-spring-weblux-5 X-plugin, but APM SDK plugin cannot directly rely on optional spring plugins.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846620788


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/java/test/apache/skywalking/apm/testcase/shenyu/gateway/init/InitRouterRunner.java:
##########
@@ -0,0 +1,285 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.shenyu.gateway.init;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.plugin.base.cache.BaseDataCache;
+import org.apache.shenyu.sync.data.api.PluginDataSubscriber;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * init gateway router runner.
+ */
+@Slf4j
+@Component
+public class InitRouterRunner implements CommandLineRunner {
+
+    @Autowired
+    private PluginDataSubscriber subscriber;
+
+    @Override
+    public void run(String... args) throws Exception {
+        String pluginData = "{\"request\":{\"id\":\"20\",\"name\":\"request\",\"config\":null,"
+                + "\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":120},\"jwt\":{\"id\":\"19\",\"name\":\"jwt\","
+                + "\"config\":\"{\\\"secretKey\\\":\\\"key\\\"}\",\"role\":\"Authentication\",\"enabled\":false,"
+                + "\"sort\":30},\"paramMapping\":{\"id\":\"22\",\"name\":\"paramMapping\","
+                + "\"config\":\"{\\\"ruleHandlePageType\\\":\\\"custom\\\"}\",\"role\":\"HttpProcess\","
+                + "\"enabled\":false,\"sort\":70},\"modifyResponse\":{\"id\":\"23\",\"name\":\"modifyResponse\","
+                + "\"config\":\"{\\\"ruleHandlePageType\\\":\\\"custom\\\"}\",\"role\":\"HttpProcess\","
+                + "\"enabled\":false,\"sort\":220},\"sign\":{\"id\":\"1\",\"name\":\"sign\",\"config\":null,"
+                + "\"role\":\"Authentication\",\"enabled\":false,\"sort\":20},\"dubbo\":{\"id\":\"6\","
+                + "\"name\":\"dubbo\",\"config\":\"{\\\"register\\\":\\\"zookeeper://localhost:2181\\\","
+                + "\\\"multiSelectorHandle\\\":\\\"1\\\",\\\"threadpool\\\":\\\"cached\\\",\\\"corethreads\\\":0,"
+                + "\\\"threads\\\":2147483647,\\\"queues\\\":0}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},"
+                + "\"motan\":{\"id\":\"17\",\"name\":\"motan\",\"config\":\"{\\\"register\\\":\\\"127.0.0"
+                + ".1:2181\\\"}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"oauth2\":{\"id\":\"21\","
+                + "\"name\":\"oauth2\",\"config\":null,\"role\":\"Authentication\",\"enabled\":false,\"sort\":40},"
+                + "\"rateLimiter\":{\"id\":\"4\",\"name\":\"rateLimiter\","
+                + "\"config\":\"{\\\"master\\\":\\\"mymaster\\\",\\\"mode\\\":\\\"standalone\\\",\\\"url\\\":\\\"192"
+                + ".168.1.1:6379\\\",\\\"password\\\":\\\"abc\\\"}\",\"role\":\"FaultTolerance\",\"enabled\":false,"
+                + "\"sort\":60},\"websocket\":{\"id\":\"26\",\"name\":\"websocket\","
+                + "\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\"}\",\"role\":\"Proxy\",\"enabled\":true,"
+                + "\"sort\":200},\"mqtt\":{\"id\":\"28\",\"name\":\"mqtt\",\"config\":\"{\\\"port\\\": 9500,"
+                + "\\\"bossGroupThreadCount\\\": 1,\\\"maxPayloadSize\\\": 65536,\\\"workerGroupThreadCount\\\": 12,"
+                + "\\\"userName\\\": \\\"shenyu\\\",\\\"password\\\": \\\"shenyu\\\",\\\"isEncryptPassword\\\": "
+                + "false,\\\"encryptMode\\\": \\\"\\\",\\\"leakDetectorLevel\\\": \\\"DISABLED\\\"}\","
+                + "\"role\":\"Proxy\",\"enabled\":false,\"sort\":125},\"tars\":{\"id\":\"13\",\"name\":\"tars "
+                + "tested\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\",\\\"multiRuleHandle\\\":\\\"0\\\"}\","
+                + "\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"cryptorRequest\":{\"id\":\"24\","
+                + "\"name\":\"cryptorRequest\",\"config\":null,\"role\":\"Cryptor\",\"enabled\":true,\"sort\":100},"
+                + "\"divide\":{\"id\":\"5\",\"name\":\"divide\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\","
+                + "\\\"multiRuleHandle\\\":\\\"0\\\"}\",\"role\":\"Proxy\",\"enabled\":true,\"sort\":200},"
+                + "\"waf\":{\"id\":\"2\",\"name\":\"waf\",\"config\":\"{\\\"model\\\":\\\"black\\\"}\","
+                + "\"role\":\"Authentication\",\"enabled\":false,\"sort\":50},\"redirect\":{\"id\":\"16\","
+                + "\"name\":\"redirect\",\"config\":null,\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":110},"
+                + "\"sentinel\":{\"id\":\"10\",\"name\":\"sentinel\",\"config\":null,\"role\":\"FaultTolerance\","
+                + "\"enabled\":false,\"sort\":140},\"hystrix\":{\"id\":\"9\",\"name\":\"hystrix\",\"config\":null,"
+                + "\"role\":\"FaultTolerance\",\"enabled\":false,\"sort\":130},\"sofa\":{\"id\":\"11\","
+                + "\"name\":\"sofa\",\"config\":\"{\\\"protocol\\\":\\\"zookeeper\\\",\\\"register\\\":\\\"127.0.0"
+                + ".1:2181\\\"}\",\"role\":\"Proxy\",\"enabled\":false,\"sort\":310},\"cache\":{\"id\":\"30\","
+                + "\"name\":\"cache\",\"config\":\"{\\\"cacheType\\\":\\\"memory\\\"}\",\"role\":\"Cache\","
+                + "\"enabled\":false,\"sort\":10},\"contextPath\":{\"id\":\"14\",\"name\":\"contextPath\","
+                + "\"config\":null,\"role\":\"HttpProcess\",\"enabled\":true,\"sort\":80},"
+                + "\"generalContext\":{\"id\":\"27\",\"name\":\"generalContext\",\"config\":null,\"role\":\"Common\","
+                + "\"enabled\":true,\"sort\":125},\"rewrite\":{\"id\":\"3\",\"name\":\"rewrite\",\"config\":null,"
+                + "\"role\":\"HttpProcess\",\"enabled\":false,\"sort\":90},\"springCloud\":{\"id\":\"8\","
+                + "\"name\":\"springCloud\",\"config\":null,\"role\":\"Proxy\",\"enabled\":false,\"sort\":200},"
+                + "\"grpc\":{\"id\":\"15\",\"name\":\"grpc\",\"config\":\"{\\\"multiSelectorHandle\\\":\\\"1\\\","
+                + "\\\"multiRuleHandle\\\":\\\"0\\\",\\\"threadpool\\\":\\\"cached\\\"}\",\"role\":\"Proxy\","
+                + "\"enabled\":false,\"sort\":310},\"resilience4j\":{\"id\":\"12\",\"name\":\"resilience4j\","
+                + "\"config\":null,\"role\":\"FaultTolerance\",\"enabled\":false,\"sort\":310},"
+                + "\"logging\":{\"id\":\"18\",\"name\":\"logging\",\"config\":null,\"role\":\"Logging\","
+                + "\"enabled\":false,\"sort\":160},\"cryptorResponse\":{\"id\":\"25\",\"name\":\"cryptorResponse\","
+                + "\"config\":null,\"role\":\"Cryptor\",\"enabled\":true,\"sort\":410},"
+                + "\"loggingRocketMQ\":{\"id\":\"29\",\"name\":\"loggingRocketMQ\","
+                + "\"config\":\"{\\\"topic\\\":\\\"shenyu-access-logging\\\", \\\"namesrvAddr\\\": "
+                + "\\\"localhost:9876\\\",\\\"producerGroup\\\":\\\"shenyu-plugin-logging-rocketmq\\\"}\","
+                + "\"role\":\"Logging\",\"enabled\":false,\"sort\":170}}";
+
+        String selectorData = "{\"contextPath\":[{\"id\":\"1512230008264994816\",\"pluginId\":\"14\","
+                + "\"pluginName\":\"contextPath\",\"name\":\"/http\",\"matchMode\":0,\"type\":1,\"sort\":1,"
+                + "\"enabled\":true,\"logged\":true,\"continued\":true,\"handle\":null,"
+                + "\"conditionList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/**\"}]}],\"divide\":[{\"id\":\"1512230008105611264\",\"pluginId\":\"5\","
+                + "\"pluginName\":\"divide\",\"name\":\"/http\",\"matchMode\":0,\"type\":1,\"sort\":1,"
+                + "\"enabled\":true,\"logged\":true,\"continued\":true,\"handle\":\"[{\\\"weight\\\":50,"
+                + "\\\"warmup\\\":10,\\\"protocol\\\":\\\"http://\\\",\\\"upstreamHost\\\":\\\"localhost\\\","
+                + "\\\"upstreamUrl\\\":\\\"localhost:8189\\\",\\\"status\\\":true,"
+                + "\\\"timestamp\\\":1649378707380}]\",\"conditionList\":[{\"paramType\":\"uri\","
+                + "\"operator\":\"match\",\"paramName\":\"/\",\"paramValue\":\"/http/**\"}]}]}\n";
+
+        String ruleData = "{\"1512230008264994816\":[{\"id\":\"1512230008290160640\",\"name\":\"/http\","
+                + "\"pluginName\":\"contextPath\",\"selectorId\":\"1512230008264994816\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"contextPath\\\":\\\"/http\\\"}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/**\"}]}],\"1512230008105611264\":[{\"id\":\"1512230008223051776\","
+                + "\"name\":\"/http/order/path/**/name\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/path/**/name\"}]},{\"id\":\"1512230008755728384\","
+                + "\"name\":\"/http/order\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order\"}]},{\"id\":\"1512230009120632832\",\"name\":\"/http/order/save\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/save\"}]},{\"id\":\"1512230009321959424\","
+                + "\"name\":\"/http/order/path/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/path/**\"}]},{\"id\":\"1512230009363902464\","
+                + "\"name\":\"/http/order/oauth2/test\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/oauth2/test\"}]},{\"id\":\"1512230009397456896\","
+                + "\"name\":\"/http/test/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/test/**\"}]},{\"id\":\"1512230009481342976\","
+                + "\"name\":\"/http/order/findById\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/order/findById\"}]},{\"id\":\"1512230009514897408\",\"name\":\"/http/\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/\"}]},{\"id\":\"1512230009586200576\",\"name\":\"/http/post/hi\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/post/hi\"}]},{\"id\":\"1512230009607172096\","
+                + "\"name\":\"/http/shenyu/client/hi\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/hi\"}]},{\"id\":\"1512230009632337920\","
+                + "\"name\":\"/http/shenyu/client/timeout\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/timeout\"}]},{\"id\":\"1512230009712029696\","
+                + "\"name\":\"/http/shenyu/client/hello\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/hello\"}]},{\"id\":\"1512230009728806912\","
+                + "\"name\":\"/http/request/**\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"match\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/request/**\"}]},{\"id\":\"1512230009787527168\",\"name\":\"/http/hello\","
+                + "\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,"
+                + "\"enabled\":true,\"loged\":true,\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\","
+                + "\\\"retryStrategy\\\":\\\"current\\\",\\\"retry\\\":3,\\\"timeout\\\":3000,"
+                + "\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/hello\"}]},{\"id\":\"1512230009804304384\","
+                + "\"name\":\"/http/shenyu/client/post/hi\",\"pluginName\":\"divide\","
+                + "\"selectorId\":\"1512230008105611264\",\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/shenyu/client/post/hi\"}]},{\"id\":\"1512230009955299328\","
+                + "\"name\":\"/http/hi\",\"pluginName\":\"divide\",\"selectorId\":\"1512230008105611264\","
+                + "\"matchMode\":0,\"sort\":1,\"enabled\":true,\"loged\":true,"
+                + "\"handle\":\"{\\\"loadBalance\\\":\\\"random\\\",\\\"retryStrategy\\\":\\\"current\\\","
+                + "\\\"retry\\\":3,\\\"timeout\\\":3000,\\\"headerMaxSize\\\":10240,\\\"requestMaxSize\\\":102400}\","
+                + "\"conditionDataList\":[{\"paramType\":\"uri\",\"operator\":\"=\",\"paramName\":\"/\","
+                + "\"paramValue\":\"/http/hi\"}]}]}";
+
+        Map<String, PluginData> pluginDataMap = GsonUtils.getInstance().toObjectMap(pluginData, PluginData.class);
+        Map<String, List<SelectorData>> selectorDataMap = GsonUtils.getInstance().toObjectMapList(selectorData, SelectorData.class);
+        Map<String, List<RuleData>> ruleDataMap = GsonUtils.getInstance().toObjectMapList(ruleData, RuleData.class);
+
+
+
+
+        BaseDataCache dataCache = BaseDataCache.getInstance();
+        pluginDataMap.values().forEach(subscriber::onSubscribe);
+        selectorDataMap.values().stream().flatMap(Collection::stream).forEach(data -> {
+
+            subscriber.onSelectorSubscribe(data);
+            // dataCache.cacheSelectData(data);
+            // DividePluginDataHandler.handlerSelector(data);
+
+        });
+        ruleDataMap.values().stream().flatMap(Collection::stream).forEach(subscriber::onRuleSubscribe);
+
+        // String contextData = "{\"cached\":{\"1512230008264994816_/http\":{\"contextPath\":\"/http\"}}}";

Review Comment:
   thinks. I have removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846713657


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/resources/shenyu-rule.json:
##########
@@ -0,0 +1,347 @@
+/**
+#
+# 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.
+#
+*/
+{
+  "1512230008264994816": [
+    {
+      "id": "1512230008290160640",

Review Comment:
   This is the ID of the rule. It has no special meaning



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846636866


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   This isn't a good practice. You are instrumenting `org.spingframework` in `shenyu` plugin, it could break others' use cases. Could you explain more?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846752180


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   Yes. Two services or one service have 2 URIs to cover the case and cost less.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846633473


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/ServerWebExchangeConstructorInterceptor.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+/**
+ * ServerWebExchange Constructor Interceptor.
+ */
+public class ServerWebExchangeConstructorInterceptor implements InstanceConstructorInterceptor {

Review Comment:
   OK, then make sure the comments mentioned this. Otherwise, the codes look very strange.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r845957200


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/bin/startup.sh:
##########
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# 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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/shenyu-2.4.x-scenario.jar &

Review Comment:
   Test case should be added into GHA control file, if you have passed the test locally.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1092701966

   Thank you very much. I will deal with these issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846620744


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/shenyu-gateway/src/main/java/test/apache/skywalking/apm/testcase/shenyu/gateway/init/InitRouterRunner.java:
##########
@@ -0,0 +1,285 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.shenyu.gateway.init;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.plugin.base.cache.BaseDataCache;
+import org.apache.shenyu.sync.data.api.PluginDataSubscriber;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * init gateway router runner.
+ */
+@Slf4j
+@Component
+public class InitRouterRunner implements CommandLineRunner {
+
+    @Autowired
+    private PluginDataSubscriber subscriber;
+
+    @Override
+    public void run(String... args) throws Exception {
+        String pluginData = "{\"request\":{\"id\":\"20\",\"name\":\"request\",\"config\":null,"

Review Comment:
   good idea.  Thank you. I've fixed it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1093943120

   > Once you confirmed you could pass tests locally, I could approve to run yours on GHA.
   
   I have passed the local test. thinks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] hutaishi commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
hutaishi commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846635103


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/ServerWebExchangeConstructorInterceptor.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+
+/**
+ * ServerWebExchange Constructor Interceptor.
+ */
+public class ServerWebExchangeConstructorInterceptor implements InstanceConstructorInterceptor {

Review Comment:
   Very good suggestion, I have commented



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#issuecomment-1094033957

   `Plugin-list.md` is not updated, so CI check fails.
   `Supported-list.md` should be updated as well for end users.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846643645


##########
apm-sniffer/apm-sdk-plugin/shenyu-2.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shenyu/v24x/define/ServerWebExchangeInstrumentation.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.skywalking.apm.plugin.shenyu.v24x.define;
+
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+
+/**
+ * ServerWebExchange Instrumentation.
+ */
+public class ServerWebExchangeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+    private static final String ENHANCE_CLASS = "org.springframework.web.server.adapter.DefaultServerWebExchange";

Review Comment:
   Yes, you can. But still, you should consider why this is a special case for Shenyu, rather than a general mechanism for spring ecosystem.(I don't know the detail, just asking)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng merged pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng merged PR #147:
URL: https://github.com/apache/skywalking-java/pull/147


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #147: Add skywaliking plugin for support Apache ShenYu (incubating) gateway (#8796)

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on code in PR #147:
URL: https://github.com/apache/skywalking-java/pull/147#discussion_r846717943


##########
test/plugin/scenarios/shenyu-2.4.x-scenario/config/expectedData.yaml:
##########
@@ -0,0 +1,80 @@
+# 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.
+segmentItems:
+  - serviceName: shenyu-http
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 14
+            isError: false
+            spanType: Entry
+            peer: ''
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+            refs:
+              - {parentEndpoint: /order/findById, networkAddress: 'localhost:8189',
+                 refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
+                 parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null}
+            skipAnalysis: 'false'
+  - serviceName: Apache-ShenYu
+    segmentSize: nq 0
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: /order/findById
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: nq 0
+            endTime: nq 0
+            componentId: 99
+            isError: false
+            spanType: Exit
+            peer: 'localhost:8189'
+            tags:
+              - {key: url, value: 'http://localhost:8189/order/findById'}
+              - {key: http.method, value: GET}
+              - {key: http.status_code, value: '200'}
+            refs:
+              - { parentEndpoint: /http/order/findById, networkAddress: '',
+                  refType: CrossThread, parentSpanId: 0, parentTraceSegmentId: not null,
+                  parentServiceInstance: not null, parentService: 'Apache-ShenYu', traceId: not null }
+            skipAnalysis: 'false'
+      - segmentId: not null
+        spans:
+          - operationName: /http/order/findById

Review Comment:
   https://github.com/apache/skywalking-java/pull/147/files#r846691996 is about this one. This ia Shenyu(127) entry span, but it doesn't include a ref(cross process).
   
   I think in `client http request -> ShenYu gateway(route to provider) -> shenyu-http(service provider)` chain,  `client http request -> ShenYu gateway` is not verified whether Shenyu's plugin could process the incoming call properly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org