This is an automated email from the ASF dual-hosted git repository.
tianpengfei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new ea05c791fa [type refactor]Adjust processor functions (#4948)
ea05c791fa is described below
commit ea05c791faec6e6d297feb1d0f7af08bb1a89ad7
Author: likeguo <[email protected]>
AuthorDate: Thu Aug 3 11:08:36 2023 +0800
[type refactor]Adjust processor functions (#4948)
* feature/register
* feature/register
* feature/processor
* feature/processor
---
.../auto/config/ClientRegisterConfiguration.java | 6 ++---
.../extractor/BaseAnnotationApiBeansExtractor.java | 29 ---------------------
.../register/extractor/BaseApiBeansExtractor.java | 24 +++++++++++++++++
.../register/matcher/ApiAnnotationProcessor.java | 2 +-
...tractorProcessor.java => ApiBeanProcessor.java} | 4 +--
...ApiProcessor.java => ApiRegisterProcessor.java} | 2 +-
.../matcher/BaseAnnotationApiProcessor.java | 2 +-
.../core/register/matcher/ExtractorProcessor.java | 30 ++++++++++++----------
.../register/registrar/BaseApiRegistrarImpl.java | 14 +++++-----
.../apache/dubbo/ApacheDubboApiBeansExtractor.java | 2 --
.../processor/extractor/DubboServiceProcessor.java | 11 +++++++-
.../processor/extractor/ServiceProcessor.java | 12 ++++++++-
.../processor/register/ShenyuDubboProcessor.java | 4 +--
.../extractor/RequestMappingProcessor.java | 12 ++++++++-
.../extractor/RequestMappingProcessor.java | 11 +++++++-
15 files changed, 99 insertions(+), 66 deletions(-)
diff --git
a/shenyu-client/shenyu-client-autoconfig/src/main/java/org/apache/shenyu/client/auto/config/ClientRegisterConfiguration.java
b/shenyu-client/shenyu-client-autoconfig/src/main/java/org/apache/shenyu/client/auto/config/ClientRegisterConfiguration.java
index 7133b02d62..a692cfbe90 100644
---
a/shenyu-client/shenyu-client-autoconfig/src/main/java/org/apache/shenyu/client/auto/config/ClientRegisterConfiguration.java
+++
b/shenyu-client/shenyu-client-autoconfig/src/main/java/org/apache/shenyu/client/auto/config/ClientRegisterConfiguration.java
@@ -23,7 +23,7 @@ import
org.apache.shenyu.client.core.register.ClientRegisterConfig;
import
org.apache.shenyu.client.core.register.extractor.MultiClientApiBeansExtractorImpl;
import org.apache.shenyu.client.core.register.extractor.RpcApiBeansExtractor;
import org.apache.shenyu.client.core.register.matcher.ApiDocProcessorImpl;
-import org.apache.shenyu.client.core.register.matcher.ApiProcessor;
+import org.apache.shenyu.client.core.register.matcher.ApiRegisterProcessor;
import org.apache.shenyu.client.core.register.registrar.ApiRegistrar;
import
org.apache.shenyu.client.core.register.registrar.MateDataApiRegistrarImplImpl;
import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
@@ -57,9 +57,9 @@ public class ClientRegisterConfiguration {
* @return register
*/
@Bean
- public MateDataApiRegistrarImplImpl mateDataApiRegistrarImpl(final
ClientRegisterConfig clientRegisterConfig, final List<ApiProcessor> processor) {
+ public MateDataApiRegistrarImplImpl mateDataApiRegistrarImpl(final
ClientRegisterConfig clientRegisterConfig, final List<ApiRegisterProcessor>
processor) {
final MateDataApiRegistrarImplImpl apiRegistrarImpl = new
MateDataApiRegistrarImplImpl(clientRegisterConfig);
- for (ApiProcessor apiProcessor : processor) {
+ for (ApiRegisterProcessor apiProcessor : processor) {
apiRegistrarImpl.addApiProcessor(apiProcessor);
}
return apiRegistrarImpl;
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseAnnotationApiBeansExtractor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseAnnotationApiBeansExtractor.java
index 9004713e2a..7230c6581c 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseAnnotationApiBeansExtractor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseAnnotationApiBeansExtractor.java
@@ -17,8 +17,6 @@
package org.apache.shenyu.client.core.register.extractor;
-import org.apache.shenyu.client.core.register.ApiBean;
-import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.NonNull;
@@ -41,8 +39,6 @@ public abstract class BaseAnnotationApiBeansExtractor extends
BaseApiBeansExtrac
private final List<Class<? extends Annotation>>
supportedApiDefinitionAnnotations = new ArrayList<>(1);
- private final List<ExtractorProcessor> extractorProcessors = new
ArrayList<>(1);
-
@Override
protected Map<String, Object> extractSupportBeans(final ApplicationContext
applicationContext) {
return supportedApiAnnotations().stream()
@@ -62,22 +58,6 @@ public abstract class BaseAnnotationApiBeansExtractor
extends BaseApiBeansExtrac
.collect(Collectors.toList());
}
- @Override
- protected void apiPostProcess(final ApiBean api) {
- for (ExtractorProcessor apiAnnotationProcessor : extractorProcessors) {
- apiAnnotationProcessor.process(api);
- }
- super.apiPostProcess(api);
- }
-
- @Override
- protected void definitionPostProcess(final ApiBean.ApiDefinition
apiDefinition) {
- for (ExtractorProcessor apiAnnotationProcessor : extractorProcessors) {
- apiAnnotationProcessor.process(apiDefinition);
- }
- super.definitionPostProcess(apiDefinition);
- }
-
/**
* Supported annotations.
*
@@ -98,15 +78,6 @@ public abstract class BaseAnnotationApiBeansExtractor
extends BaseApiBeansExtrac
return supportedApiDefinitionAnnotations;
}
- /**
- * addExtractorProcessor.
- *
- * @param processor processor.
- */
- public void addExtractorProcessor(final ExtractorProcessor processor) {
- extractorProcessors.add(processor);
- }
-
/**
* addSupportedApiDefinitionAnnotations.
*
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseApiBeansExtractor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseApiBeansExtractor.java
index 4a6d72415c..6010e7983f 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseApiBeansExtractor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/extractor/BaseApiBeansExtractor.java
@@ -18,6 +18,7 @@
package org.apache.shenyu.client.core.register.extractor;
import org.apache.shenyu.client.core.register.ApiBean;
+import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -26,6 +27,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -41,6 +43,8 @@ public abstract class BaseApiBeansExtractor implements
RpcApiBeansExtractor {
protected static final Logger LOG =
LoggerFactory.getLogger(BaseApiBeansExtractor.class);
+ private final List<ExtractorProcessor> extractorProcessors = new
ArrayList<>(5);
+
@Override
public List<ApiBean> extract(final ApplicationContext applicationContext) {
@@ -85,6 +89,9 @@ public abstract class BaseApiBeansExtractor implements
RpcApiBeansExtractor {
* @param api api
*/
protected void apiPostProcess(final ApiBean api) {
+ for (ExtractorProcessor apiAnnotationProcessor : extractorProcessors) {
+ apiAnnotationProcessor.process(api);
+ }
LOG.debug("[Shenyu Client] extract api info [{}]", api);
}
@@ -140,6 +147,9 @@ public abstract class BaseApiBeansExtractor implements
RpcApiBeansExtractor {
* @param apiDefinition apiDefinition
*/
protected void definitionPostProcess(final ApiBean.ApiDefinition
apiDefinition) {
+ for (ExtractorProcessor apiAnnotationProcessor : extractorProcessors) {
+ apiAnnotationProcessor.process(apiDefinition);
+ }
LOG.debug("[Shenyu Client] extract api definition info [{}]",
apiDefinition);
}
@@ -176,6 +186,20 @@ public abstract class BaseApiBeansExtractor implements
RpcApiBeansExtractor {
.collect(Collectors.toList());
}
+ /**
+ * addExtractorProcessor.
+ *
+ * @param processor processor.
+ */
+ public void addExtractorProcessor(final ExtractorProcessor processor) {
+ if (CollectionUtils.isEmpty(processor.supportedClient())) {
+ return;
+ }
+ if (processor.supportedClient().contains(clientName())) {
+ extractorProcessors.add(processor);
+ }
+ }
+
/**
* Extracts the collection of instances of supported beans.<br>
* key is bean name<br>
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiAnnotationProcessor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiAnnotationProcessor.java
index fc93b18726..b352339520 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiAnnotationProcessor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiAnnotationProcessor.java
@@ -25,7 +25,7 @@ import java.util.Objects;
/**
* ApiAnnotationProcessor.
*/
-public interface ApiAnnotationProcessor<T extends Annotation> extends
ExtractorProcessor {
+public interface ApiAnnotationProcessor<T extends Annotation> extends
ApiBeanProcessor {
/**
* process.
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiBeanProcessor.java
similarity index 94%
copy from
shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
copy to
shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiBeanProcessor.java
index b091af3144..0cb02e4013 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiBeanProcessor.java
@@ -20,9 +20,9 @@ package org.apache.shenyu.client.core.register.matcher;
import org.apache.shenyu.client.core.register.ApiBean;
/**
- * ApiAnnotationProcessor.
+ * ApiBeanProcessor.
*/
-public interface ExtractorProcessor {
+public interface ApiBeanProcessor {
/**
* process.
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiProcessor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiRegisterProcessor.java
similarity index 96%
rename from
shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiProcessor.java
rename to
shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiRegisterProcessor.java
index 4f0dd3930f..56e093b208 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiProcessor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ApiRegisterProcessor.java
@@ -27,7 +27,7 @@ import java.util.List;
* ApiProcessor.<br>
* API bean processor.
*/
-public interface ApiProcessor extends Matcher<ApiBean> {
+public interface ApiRegisterProcessor extends Matcher<ApiBean> {
/**
* process.
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/BaseAnnotationApiProcessor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/BaseAnnotationApiProcessor.java
index adf3808532..266a5914f4 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/BaseAnnotationApiProcessor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/BaseAnnotationApiProcessor.java
@@ -26,7 +26,7 @@ import java.util.Objects;
* BaseAnnotationApiProcessor.<br>
* API processor that supports annotations.
*/
-public abstract class BaseAnnotationApiProcessor<T extends Annotation>
implements ApiAnnotationProcessor<T>, ApiProcessor {
+public abstract class BaseAnnotationApiProcessor<T extends Annotation>
implements ApiAnnotationProcessor<T>, ApiRegisterProcessor {
@Override
public void process(final ApiBean apiBean) {
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
index b091af3144..6753d4f1f4 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/matcher/ExtractorProcessor.java
@@ -17,25 +17,27 @@
package org.apache.shenyu.client.core.register.matcher;
-import org.apache.shenyu.client.core.register.ApiBean;
+import org.apache.shenyu.common.enums.RpcTypeEnum;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
/**
- * ApiAnnotationProcessor.
+ * ApiAnnotationProcessor.<br>
+ * Supports post-extraction and processing of client metadata.
*/
-public interface ExtractorProcessor {
-
- /**
- * process.
- *
- * @param apiBean apiBean
- */
- void process(ApiBean apiBean);
+public interface ExtractorProcessor extends ApiBeanProcessor {
/**
- * process.
+ * By default, all client pairs are supported.
*
- * @param definition definition
+ * @return support type.
+ * @see RpcTypeEnum
*/
- void process(ApiBean.ApiDefinition definition);
-
+ default List<String> supportedClient() {
+ return Arrays.stream(RpcTypeEnum.values())
+ .map(RpcTypeEnum::getName)
+ .collect(Collectors.toList());
+ }
}
diff --git
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/registrar/BaseApiRegistrarImpl.java
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/registrar/BaseApiRegistrarImpl.java
index 8db9128943..7b77480da6 100644
---
a/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/registrar/BaseApiRegistrarImpl.java
+++
b/shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/register/registrar/BaseApiRegistrarImpl.java
@@ -18,7 +18,7 @@
package org.apache.shenyu.client.core.register.registrar;
import org.apache.shenyu.client.core.register.ApiBean;
-import org.apache.shenyu.client.core.register.matcher.ApiProcessor;
+import org.apache.shenyu.client.core.register.matcher.ApiRegisterProcessor;
import org.springframework.beans.factory.InitializingBean;
import java.util.ArrayList;
@@ -30,11 +30,11 @@ import java.util.List;
*/
public abstract class BaseApiRegistrarImpl implements ApiRegistrar,
InitializingBean {
- private final List<ApiProcessor> processors = new ArrayList<>();
+ private final List<ApiRegisterProcessor> processors = new ArrayList<>();
@Override
public void afterPropertiesSet() {
- processors.sort(Comparator.comparingInt(ApiProcessor::order));
+ processors.sort(Comparator.comparingInt(ApiRegisterProcessor::order));
}
/**
@@ -42,16 +42,16 @@ public abstract class BaseApiRegistrarImpl implements
ApiRegistrar, Initializing
*
* @param processor processor
*/
- public void addApiProcessor(final ApiProcessor processor) {
+ public void addApiProcessor(final ApiRegisterProcessor processor) {
if (supportedType(processor)) {
processors.add(processor);
- processors.sort(Comparator.comparingInt(ApiProcessor::order));
+
processors.sort(Comparator.comparingInt(ApiRegisterProcessor::order));
}
}
@Override
public void register(final ApiBean apiBean) {
- for (ApiProcessor processor : processors) {
+ for (ApiRegisterProcessor processor : processors) {
processor.process(apiBean);
}
if (ApiBean.Status.INIT.equals(apiBean.getStatus())) {
@@ -81,7 +81,7 @@ public abstract class BaseApiRegistrarImpl implements
ApiRegistrar, Initializing
}
}
- private boolean supportedType(final ApiProcessor processor) {
+ private boolean supportedType(final ApiRegisterProcessor processor) {
for (Class<?> type : processor.supportedRegisterDataType()) {
if (type.isAssignableFrom(registerDataType())) {
return true;
diff --git
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboApiBeansExtractor.java
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboApiBeansExtractor.java
index d67c65a8d7..06246ee9de 100644
---
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboApiBeansExtractor.java
+++
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/ApacheDubboApiBeansExtractor.java
@@ -21,7 +21,6 @@ import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Service;
import
org.apache.shenyu.client.apache.dubbo.processor.extractor.DubboServiceProcessor;
import
org.apache.shenyu.client.apache.dubbo.processor.extractor.ServiceProcessor;
-import
org.apache.shenyu.client.apache.dubbo.processor.register.ShenyuDubboProcessor;
import
org.apache.shenyu.client.core.register.extractor.BaseAnnotationApiBeansExtractor;
import org.apache.shenyu.client.core.register.extractor.RpcApiBeansExtractor;
import org.apache.shenyu.common.enums.RpcTypeEnum;
@@ -37,7 +36,6 @@ public class ApacheDubboApiBeansExtractor extends
BaseAnnotationApiBeansExtracto
addExtractorProcessor(new DubboServiceProcessor());
addExtractorProcessor(new ServiceProcessor());
- addExtractorProcessor(new ShenyuDubboProcessor());
}
@Override
diff --git
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/DubboServiceProcessor.java
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/DubboServiceProcessor.java
index 8fa6773d77..71e4602c68 100644
---
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/DubboServiceProcessor.java
+++
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/DubboServiceProcessor.java
@@ -23,10 +23,14 @@ import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.spring.ServiceBean;
import org.apache.shenyu.client.core.register.ApiBean;
import org.apache.shenyu.client.core.register.matcher.ApiAnnotationProcessor;
+import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
import org.apache.shenyu.client.dubbo.common.dto.DubboRpcExt;
import org.apache.shenyu.common.constant.Constants;
+import org.apache.shenyu.common.enums.RpcTypeEnum;
import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.common.utils.ListUtil;
+import java.util.List;
import java.util.Optional;
import static org.apache.dubbo.remoting.Constants.DEFAULT_CONNECT_TIMEOUT;
@@ -34,7 +38,12 @@ import static
org.apache.dubbo.remoting.Constants.DEFAULT_CONNECT_TIMEOUT;
/**
* DubboServiceProcessor.
*/
-public class DubboServiceProcessor implements
ApiAnnotationProcessor<DubboService> {
+public class DubboServiceProcessor implements
ApiAnnotationProcessor<DubboService>, ExtractorProcessor {
+
+ @Override
+ public List<String> supportedClient() {
+ return ListUtil.of(RpcTypeEnum.DUBBO.getName());
+ }
@Override
public void process(final ApiBean apiBean, final DubboService annotation) {
diff --git
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/ServiceProcessor.java
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/ServiceProcessor.java
index 42881598cd..4473573346 100644
---
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/ServiceProcessor.java
+++
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/extractor/ServiceProcessor.java
@@ -19,12 +19,22 @@ package
org.apache.shenyu.client.apache.dubbo.processor.extractor;
import org.apache.shenyu.client.core.register.ApiBean;
import org.apache.shenyu.client.core.register.matcher.ApiAnnotationProcessor;
+import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
+import org.apache.shenyu.common.enums.RpcTypeEnum;
+import org.apache.shenyu.common.utils.ListUtil;
import org.springframework.stereotype.Service;
+import java.util.List;
+
/**
* ServiceProcessor.
*/
-public class ServiceProcessor implements ApiAnnotationProcessor<Service> {
+public class ServiceProcessor implements ApiAnnotationProcessor<Service>,
ExtractorProcessor {
+
+ @Override
+ public List<String> supportedClient() {
+ return ListUtil.of(RpcTypeEnum.DUBBO.getName());
+ }
@Override
public void process(final ApiBean apiBean, final Service annotation) {
diff --git
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/register/ShenyuDubboProcessor.java
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/register/ShenyuDubboProcessor.java
index 7bdc4749fd..53655050ba 100644
---
a/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/register/ShenyuDubboProcessor.java
+++
b/shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/main/java/org/apache/shenyu/client/apache/dubbo/processor/register/ShenyuDubboProcessor.java
@@ -18,14 +18,14 @@
package org.apache.shenyu.client.apache.dubbo.processor.register;
import org.apache.shenyu.client.core.register.ApiBean;
-import org.apache.shenyu.client.core.register.matcher.ApiProcessor;
+import org.apache.shenyu.client.core.register.matcher.ApiRegisterProcessor;
import
org.apache.shenyu.client.core.register.matcher.BaseAnnotationApiProcessor;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
/**
* ShenyuDubboProcessor.
*/
-public class ShenyuDubboProcessor extends
BaseAnnotationApiProcessor<ShenyuDubboClient> implements ApiProcessor {
+public class ShenyuDubboProcessor extends
BaseAnnotationApiProcessor<ShenyuDubboClient> implements ApiRegisterProcessor {
@Override
public void process(final ApiBean apiBean, final ShenyuDubboClient
annotation) {
diff --git
a/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/proceeor/extractor/RequestMappingProcessor.java
b/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/proceeor/extractor/RequestMappingProcessor.java
index 57b2b32fd2..ee5e77afde 100644
---
a/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/proceeor/extractor/RequestMappingProcessor.java
+++
b/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/proceeor/extractor/RequestMappingProcessor.java
@@ -20,15 +20,25 @@ package
org.apache.shenyu.client.springcloud.proceeor.extractor;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.shenyu.client.core.register.ApiBean;
import org.apache.shenyu.client.core.register.matcher.ApiAnnotationProcessor;
+import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
+import org.apache.shenyu.common.enums.RpcTypeEnum;
+import org.apache.shenyu.common.utils.ListUtil;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.RequestMapping;
+import java.util.List;
import java.util.Objects;
/**
* RequestMappingProcessor.
*/
-public class RequestMappingProcessor implements
ApiAnnotationProcessor<RequestMapping> {
+public class RequestMappingProcessor implements
ApiAnnotationProcessor<RequestMapping>, ExtractorProcessor {
+
+ @Override
+ public List<String> supportedClient() {
+ return ListUtil.of(RpcTypeEnum.SPRING_CLOUD.getName());
+ }
+
@Override
public void process(final ApiBean api, final RequestMapping annotation) {
diff --git
a/shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/proceeor/extractor/RequestMappingProcessor.java
b/shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/proceeor/extractor/RequestMappingProcessor.java
index 63d8a79434..35f66c8be2 100644
---
a/shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/proceeor/extractor/RequestMappingProcessor.java
+++
b/shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/proceeor/extractor/RequestMappingProcessor.java
@@ -20,15 +20,24 @@ package
org.apache.shenyu.client.springmvc.proceeor.extractor;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.shenyu.client.core.register.ApiBean;
import org.apache.shenyu.client.core.register.matcher.ApiAnnotationProcessor;
+import org.apache.shenyu.client.core.register.matcher.ExtractorProcessor;
+import org.apache.shenyu.common.enums.RpcTypeEnum;
+import org.apache.shenyu.common.utils.ListUtil;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.RequestMapping;
+import java.util.List;
import java.util.Objects;
/**
* RequestMappingProcessor.
*/
-public class RequestMappingProcessor implements
ApiAnnotationProcessor<RequestMapping> {
+public class RequestMappingProcessor implements
ApiAnnotationProcessor<RequestMapping>, ExtractorProcessor {
+
+ @Override
+ public List<String> supportedClient() {
+ return ListUtil.of(RpcTypeEnum.HTTP.getName());
+ }
@Override
public void process(final ApiBean api, final RequestMapping annotation) {