Skip to content

Commit

Permalink
[3.1] Fix 3.1 circular dependency (#10259)
Browse files Browse the repository at this point in the history
* [3.1] Fix 3.1 circular dependency

* fix dependency

* fix dependency

* fix pom
  • Loading branch information
AlbumenJ authored Jul 3, 2022
1 parent f48fbd8 commit b5e7598
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.metadata.MetadataService;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
import org.apache.dubbo.rpc.Protocol;
import org.apache.dubbo.rpc.ProtocolServer;
import org.apache.dubbo.rpc.model.ApplicationModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.dubbo.common.deploy.ApplicationDeployListener;
import org.apache.dubbo.common.lang.Prioritized;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
import org.apache.dubbo.rpc.model.ApplicationModel;

import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_METADATA_STORAGE_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.config.integration.IntegrationTest;
import org.apache.dubbo.config.metadata.MetadataServiceDelegation;
import org.apache.dubbo.registry.RegistryServiceListener;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
import org.apache.dubbo.test.check.registrycenter.config.ZookeeperConfig;
import org.apache.dubbo.test.check.registrycenter.config.ZookeeperRegistryCenterConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package org.apache.dubbo.config.integration.multiple.servicediscoveryregistry;

import org.apache.dubbo.config.metadata.MetadataServiceDelegation;
import org.apache.dubbo.registry.client.ServiceDiscoveryRegistry;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;

/**
* The instance to wrap {@link org.apache.dubbo.registry.client.ServiceDiscoveryRegistry}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
import org.apache.dubbo.config.ServiceListener;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.config.integration.IntegrationTest;
import org.apache.dubbo.config.metadata.MetadataServiceDelegation;
import org.apache.dubbo.metadata.MetadataInfo;
import org.apache.dubbo.metadata.MetadataService;
import org.apache.dubbo.registry.ListenerRegistryWrapper;
import org.apache.dubbo.registry.Registry;
import org.apache.dubbo.registry.client.ServiceDiscoveryRegistry;
import org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
import org.apache.dubbo.registry.client.migration.MigrationInvoker;
import org.apache.dubbo.registry.support.RegistryManager;
import org.apache.dubbo.registry.zookeeper.ZookeeperServiceDiscovery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//import org.apache.dubbo.config.bootstrap.DubboBootstrap;
//import org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter;
//import org.apache.dubbo.config.metadata.ExporterDeployListener;
//import org.apache.dubbo.config.metadata.MetadataServiceDelegation;
//import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
//import org.apache.dubbo.config.provider.impl.DemoServiceImpl;
//import org.apache.dubbo.rpc.model.ApplicationModel;
//import org.apache.dubbo.rpc.model.FrameworkModel;
Expand Down
25 changes: 21 additions & 4 deletions dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<grizzly_version>2.4.4</grizzly_version>
<httpclient_version>4.5.13</httpclient_version>
<httpcore_version>4.4.6</httpcore_version>
<fastjson_version>1.2.70</fastjson_version>
<fastjson_version>1.2.83</fastjson_version>
<zookeeper_version>3.4.14</zookeeper_version>
<curator_version>4.2.0</curator_version>
<curator_test_version>2.12.0</curator_test_version>
Expand Down Expand Up @@ -133,8 +133,10 @@
<resteasy_version>3.0.19.Final</resteasy_version>
<tomcat_embed_version>8.5.69</tomcat_embed_version>
<jetcd_version>0.5.3</jetcd_version>
<nacos_version>2.0.4</nacos_version>
<grpc.version>1.31.1</grpc.version>
<nacos_version>2.1.0</nacos_version>
<grpc.version>1.44.0</grpc.version>
<grpc_contrib_verdion>0.8.1</grpc_contrib_verdion>
<jprotoc_version>1.2.1</jprotoc_version>
<!-- Log libs -->
<slf4j_version>1.7.25</slf4j_version>
<jcl_version>1.2</jcl_version>
Expand Down Expand Up @@ -166,7 +168,7 @@
<bouncycastle-bcprov_version>1.68</bouncycastle-bcprov_version>
<metrics_version>2.0.1</metrics_version>
<sofa_registry_version>5.2.0</sofa_registry_version>
<gson_version>2.8.5</gson_version>
<gson_version>2.8.9</gson_version>
<jsonrpc_version>1.2.0</jsonrpc_version>
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
<portlet_version>2.0</portlet_version>
Expand Down Expand Up @@ -726,6 +728,21 @@
<artifactId>grpc-grpclb</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-context</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>com.salesforce.servicelibs</groupId>
<artifactId>grpc-contrib</artifactId>
<version>${grpc_contrib_verdion}</version>
</dependency>
<dependency>
<groupId>com.salesforce.servicelibs</groupId>
<artifactId>jprotoc</artifactId>
<version>${jprotoc_version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions dubbo-registry/dubbo-registry-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,5 @@
<artifactId>zookeeper</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-config-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import org.apache.dubbo.common.utils.NamedThreadFactory;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.config.metadata.MetadataServiceDelegation;
import org.apache.dubbo.metadata.InstanceMetadataChangedListener;
import org.apache.dubbo.metadata.MetadataService;
import org.apache.dubbo.metadata.RevisionResolver;
import org.apache.dubbo.registry.Constants;
import org.apache.dubbo.registry.client.event.ServiceInstancesChangedEvent;
import org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener;
import org.apache.dubbo.registry.client.metadata.MetadataServiceDelegation;
import org.apache.dubbo.registry.client.metadata.MetadataUtils;
import org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils;
import org.apache.dubbo.rpc.RpcException;
Expand Down Expand Up @@ -261,7 +261,7 @@ private String computeKey(ServiceInstance serviceInstance) {
}

private synchronized MetadataService getMetadataServiceProxy(ServiceInstance instance) {
return metadataServiceProxies.computeIfAbsent(computeKey(instance), k -> MetadataUtils.referProxy(instance));
return metadataServiceProxies.computeIfAbsent(computeKey(instance), k -> MetadataUtils.referProxy(instance).getProxy());
}

private synchronized void destroyMetadataServiceProxy(ServiceInstance instance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.config.metadata;
package org.apache.dubbo.registry.client.metadata;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private static ServiceInstance selectInstance(List<ServiceInstance> instances) {
return instances.get(ThreadLocalRandom.current().nextInt(0, instances.size()));
}

private static class ProxyHolder {
public static class ProxyHolder {
private final ConsumerModel consumerModel;
private final MetadataService proxy;
private final ModuleModel internalModel;
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<modules>
<module>dubbo-common</module>
<module>dubbo-container</module>
<module>dubbo-compiler</module>
<module>dubbo-remoting</module>
<module>dubbo-rpc</module>
<module>dubbo-cluster</module>
Expand Down Expand Up @@ -325,10 +326,10 @@
**/org/apache/dubbo/common/serialize/protobuf/support/wrapper/MapValue.java,
**/org/apache/dubbo/common/serialize/protobuf/support/wrapper/ThrowablePB.java,
**/org/apache/dubbo/triple/TripleWrapper.java,
**/istio/v1/auth/Ca.java,
**/istio/v1/auth/IstioCertificateServiceGrpc.java,
**/istio/v1/auth/**/*,
**/com/google/rpc/*,
**/generated/**/*,
**/generated-sources/**/*,
**/grpc/health/**/*,
**/grpc/reflection/**/*,
**/target/**/*,
Expand Down

0 comments on commit b5e7598

Please sign in to comment.