You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/11/09 03:00:47 UTC

[dubbo] branch 3.0 updated: Clean dubbo-registry-consul and dubbo-demo-xml-provider-backend module (#9224)

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

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


The following commit(s) were added to refs/heads/3.0 by this push:
     new 61e778f  Clean dubbo-registry-consul and  dubbo-demo-xml-provider-backend module (#9224)
61e778f is described below

commit 61e778f8678d8a5a34a396b19b682d9246854d9a
Author: huazhongming <cr...@gmail.com>
AuthorDate: Tue Nov 9 11:00:35 2021 +0800

    Clean dubbo-registry-consul and  dubbo-demo-xml-provider-backend module (#9224)
    
    * clean dubbo-registry-consul module
    
    * remove dubbo-demo-xml-provider-backend module
---
 .../dubbo-demo-xml-provider-backend/pom.xml        | 107 ---------------------
 .../demo/provider/chain/ChainApplication.java      |  27 ------
 .../demo/provider/chain/ChainServiceImpl.java      |  33 -------
 .../src/main/resources/dubbo.properties            |   1 -
 .../src/main/resources/log4j.properties            |   7 --
 .../main/resources/spring/dubbo-provider-chain.xml |  35 -------
 .../dubbo/registry/consul/ConsulParameter.java     |  87 -----------------
 .../consul/ConsulServiceDiscoveryFactory.java      |  30 ------
 ...e.dubbo.registry.client.ServiceDiscoveryFactory |   1 -
 9 files changed, 328 deletions(-)

diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/pom.xml b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/pom.xml
deleted file mode 100644
index bceae6a..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<!--
-  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/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.dubbo</groupId>
-        <artifactId>dubbo-demo-xml</artifactId>
-        <version>${revision}</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <artifactId>dubbo-demo-xml-provider-backend</artifactId>
-    <packaging>jar</packaging>
-    <name>${project.artifactId}</name>
-    <description>The demo provider module of dubbo project</description>
-    <properties>
-        <skip_maven_deploy>true</skip_maven_deploy>
-        <slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-demo-interface</artifactId>
-            <version>${project.parent.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-registry-multicast</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-registry-nacos</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba.nacos</groupId>
-            <artifactId>nacos-client</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-registry-zookeeper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-configcenter-zookeeper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-configcenter-nacos</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-metadata-report-nacos</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-metadata-report-zookeeper</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-rpc-dubbo</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-config-spring</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-remoting-netty4</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-serialization-hessian2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dubbo</groupId>
-            <artifactId>dubbo-qos</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${slf4j-log4j12.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainApplication.java b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainApplication.java
deleted file mode 100644
index f57e635..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainApplication.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.demo.provider.chain;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class ChainApplication {
-    public static void main(String[] args) throws Exception {
-        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-provider-chain.xml");
-        context.start();
-        System.in.read();
-    }
-}
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainServiceImpl.java b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainServiceImpl.java
deleted file mode 100644
index 39662a5..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/java/org/apache/dubbo/demo/provider/chain/ChainServiceImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.demo.provider.chain;
-
-import org.apache.dubbo.demo.ChainService;
-import org.apache.dubbo.rpc.RpcContext;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChainServiceImpl implements ChainService {
-    private static final Logger logger = LoggerFactory.getLogger(ChainServiceImpl.class);
-
-    @Override
-    public String chain(String input) {
-        logger.info("Received " + input + ", request from consumer: " + RpcContext.getServiceContext().getRemoteAddress());
-        return "Received " + input + ", response from provider: " + RpcContext.getServiceContext().getLocalAddress();
-    }
-}
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/dubbo.properties b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/dubbo.properties
deleted file mode 100644
index ad602ba..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/dubbo.properties
+++ /dev/null
@@ -1 +0,0 @@
-dubbo.application.qos.port=22222
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/log4j.properties b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/log4j.properties
deleted file mode 100644
index 8de4c4f..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-###set log levels###
-log4j.rootLogger=info, stdout
-###output to the console###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2}: %m%n
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/spring/dubbo-provider-chain.xml b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/spring/dubbo-provider-chain.xml
deleted file mode 100644
index d677188..0000000
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider-backend/src/main/resources/spring/dubbo-provider-chain.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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.
-  -->
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
-       xmlns="http://www.springframework.org/schema/beans"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
-       http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
-
-    <dubbo:application metadata-type="remote" name="demo-provider-chain"/>
-    <dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>
-
-    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
-
-    <dubbo:protocol name="dubbo" port="-1"/>
-
-    <bean id="chainService" class="org.apache.dubbo.demo.provider.chain.ChainServiceImpl"/>
-
-    <dubbo:service group="g2" interface="org.apache.dubbo.demo.ChainService" ref="chainService"/>
-
-</beans>
diff --git a/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulParameter.java b/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulParameter.java
deleted file mode 100644
index f3fb024..0000000
--- a/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulParameter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.registry.consul;
-
-import org.apache.dubbo.common.URL;
-
-import static org.apache.dubbo.common.utils.StringUtils.isBlank;
-
-/**
- * The enumeration for the Consul's parameters on the {@link URL}
- *
- * @see URL#getParameters()
- * @since 2.7.8
- */
-public enum ConsulParameter {
-
-    ACL_TOKEN,
-
-    TAGS,
-
-    INSTANCE_ZONE,
-
-    DEFAULT_ZONE_METADATA_NAME("zone"),
-
-    INSTANCE_GROUP,
-
-    CONSISTENCY_MODE,
-
-    ;
-
-    private final String name;
-
-    private final String defaultValue;
-
-    ConsulParameter() {
-        this(null);
-    }
-
-    ConsulParameter(String defaultValue) {
-        this(null, defaultValue);
-    }
-
-    ConsulParameter(String name, String defaultValue) {
-        this.name = isBlank(name) ? defaultName() : name;
-        this.defaultValue = defaultValue;
-    }
-
-    private String defaultName() {
-        return name().toLowerCase().replace('_', '-');
-    }
-
-    /**
-     * The parameter value from the specified registry {@link URL}
-     *
-     * @param registryURL the specified registry {@link URL}
-     * @return <code>defaultValue</code> if not found
-     */
-    public String getValue(URL registryURL) {
-        return registryURL.getParameter(name, defaultValue);
-    }
-
-    /**
-     * The parameter value from the specified registry {@link URL}
-     *
-     * @param registryURL  the specified registry {@link URL}
-     * @param valueType    the type of parameter value
-     * @param defaultValue the default value if parameter is absent
-     * @return <code>defaultValue</code> if not found
-     */
-    public <T> T getValue(URL registryURL, Class<T> valueType, T defaultValue) {
-        return registryURL.getParameter(name, valueType, defaultValue);
-    }
-}
diff --git a/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulServiceDiscoveryFactory.java b/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulServiceDiscoveryFactory.java
deleted file mode 100644
index bd77db8..0000000
--- a/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulServiceDiscoveryFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.registry.consul;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.registry.client.AbstractServiceDiscoveryFactory;
-import org.apache.dubbo.registry.client.ServiceDiscovery;
-
-public class ConsulServiceDiscoveryFactory extends AbstractServiceDiscoveryFactory {
-
-    @Override
-    protected ServiceDiscovery createDiscovery(URL registryURL) {
-        return new ConsulServiceDiscovery();
-    }
-
-}
diff --git a/dubbo-registry/dubbo-registry-consul/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory b/dubbo-registry/dubbo-registry-consul/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory
deleted file mode 100644
index a0f1252..0000000
--- a/dubbo-registry/dubbo-registry-consul/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.registry.client.ServiceDiscoveryFactory
+++ /dev/null
@@ -1 +0,0 @@
-consul=org.apache.dubbo.registry.consul.ConsulServiceDiscoveryFactory
\ No newline at end of file