Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Merge CommonConfigPostProcessor and ConfigPostProcessor #13959 #14040

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

/**
* 2019/12/30
* it will be instead of CommonConfigPostProcessor
*/
@Deprecated
@SPI(scope = ExtensionScope.MODULE)
public interface ConfigPostProcessor extends CommonConfigPostProcessor {
public interface ConfigPostProcessor {

default void postProcessReferConfig(ReferenceConfig referenceConfig) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,14 +857,9 @@ protected boolean shouldJvmRefer(Map<String, String> map) {
private void postProcessConfig() {
List<ConfigPostProcessor> configPostProcessors = this.getExtensionLoader(ConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://"), (String[]) null);
List<CommonConfigPostProcessor> commonConfigPostProcessors = this.getExtensionLoader(
CommonConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://"), (String[]) null);

HashSet<CommonConfigPostProcessor> allConfigPostProcessor = new HashSet<>();
HashSet<ConfigPostProcessor> allConfigPostProcessor = new HashSet<>();

// merge common and old config
allConfigPostProcessor.addAll(commonConfigPostProcessors);
allConfigPostProcessor.addAll(configPostProcessors);

allConfigPostProcessor.forEach(component -> component.postProcessReferConfig(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,14 +1000,9 @@ private boolean isOnlyInJvm() {
private void postProcessConfig() {
List<ConfigPostProcessor> configPostProcessors = this.getExtensionLoader(ConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://", getScopeModel()), (String[]) null);
List<CommonConfigPostProcessor> commonConfigPostProcessors = this.getExtensionLoader(
CommonConfigPostProcessor.class)
.getActivateExtension(URL.valueOf("configPostProcessor://"), (String[]) null);

HashSet<CommonConfigPostProcessor> allConfigPostProcessor = new HashSet<>();
HashSet<ConfigPostProcessor> allConfigPostProcessor = new HashSet<>();

// merge common and old config
allConfigPostProcessor.addAll(commonConfigPostProcessors);
allConfigPostProcessor.addAll(configPostProcessors);

allConfigPostProcessor.forEach(component -> component.postProcessServiceConfig(this));
Expand Down
2 changes: 1 addition & 1 deletion dubbo-distribution/dubbo-all-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.ConfigPostProcessor</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
Expand Down
2 changes: 1 addition & 1 deletion dubbo-distribution/dubbo-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.ConfigPostProcessor</resource>
</transformer>

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
Expand Down
2 changes: 1 addition & 1 deletion dubbo-distribution/dubbo-core-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
<resource>META-INF/dubbo/internal/org.apache.dubbo.common.json.JsonUtil</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.CommonConfigPostProcessor</resource>
<resource>META-INF/dubbo/internal/org.apache.dubbo.config.ConfigPostProcessor</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.integration.ServiceURLCustomizer</resource>
Expand Down
6 changes: 6 additions & 0 deletions dubbo-rpc/dubbo-rpc-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,11 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-config-api</artifactId>
<version>3.2.9</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
import org.apache.dubbo.common.utils.AnnotationUtils;
import org.apache.dubbo.common.utils.ClassUtils;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.config.CommonConfigPostProcessor;
import org.apache.dubbo.config.ReferenceConfigBase;
import org.apache.dubbo.config.ConfigPostProcessor;
import org.apache.dubbo.config.ReferenceConfig;

import java.lang.annotation.Annotation;

/**
* parsing @FeignClient service name attribute to replace reference config provided by
*/
@Activate
public class FeignClientAnnotationConfigPostProcessor implements CommonConfigPostProcessor {
public class FeignClientAnnotationConfigPostProcessor implements ConfigPostProcessor {

@Override
public void postProcessReferConfig(ReferenceConfigBase referenceConfig) {
public void postProcessReferConfig(ReferenceConfig referenceConfig) {
appendParametersFromInterfaceClassMetadata(referenceConfig.getInterfaceClass(), referenceConfig);
}

public static void appendParametersFromInterfaceClassMetadata(
Class<?> interfaceClass, ReferenceConfigBase referenceConfig) {
Class<?> interfaceClass, ReferenceConfig referenceConfig) {

if (interfaceClass == null) {
return;
Expand Down
6 changes: 6 additions & 0 deletions dubbo-spring-boot/dubbo-spring-boot-interceptor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<artifactId>spring-boot-starter-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-api</artifactId>
<version>3.3.0-beta.2-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>