Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.4

Java version: 1.8

Scenario

We have an interface provided in two IDC clusters. We call them BJ / HZ.

The target interface we call it AService.

In project AProject we want to subscribe AService separately from both BJ and HZ for different beans' registering.

In XML age we can easily achieving that by

<dubbo:registry id="ARegistry" address="xxx" />
<dubbo:registry id="BRegistry" address="zzz" register="false" />
<dubbo:consumer registry="ARegistry" .... />
<dubbo:consumer interface="AService" id="beanA />
<dubbo:consumer interface="AService" id="beanB" registry="BRegistry />

But in dubbo.properties, it's hard and the correct way is:

# main registry
dubbo.registry.id=registryMain
dubbo.registry.address=xxxx
dubbo.registry.file=logs/dubbo-registry-main.properties
dubbo.registry.protocol=zookeeper

# second registry
dubbo.registries.registryOther.id=registryOther
dubbo.registries.registryOther.address=zzzz
dubbo.registries.registryOther.file=logs/dubbo-registry-other.properties
dubbo.registries.registryOther.protocol=zookeeper
dubbo.registries.registryOther.register=false

dubbo.provider.timeout=30000
dubbo.provider.registryIds=registryMain

dubbo.consumer.id=consumerMain
dubbo.consumer.registryIds=registryMain
dubbo.consumer.timeout=30000
dubbo.consumer.retries=0
dubbo.consumer.default=true ########## important

dubbo.consumers.consumerOther.id=consumerOther
dubbo.consumers.consumerOther.registryIds=registryOther
dubbo.consumers.consumerOther.timeout=30000
dubbo.consumers.consumerOther.retries=0
dubbo.consumers.consumerOther.default=false ####### important

dubbo.monitor.protocol=registry

And when reference:

@Reference
private AService beanA;
@Reference(consumer = "consumerOther", injvm = false, id = "beanB")
private AService beanB;

Following will not achieve it:

# main registry
dubbo.registry.id=registryMain
dubbo.registry.address=xxxx
dubbo.registry.file=logs/dubbo-registry-main.properties
dubbo.registry.protocol=zookeeper
dubbo.registry.default=true #########

# second registry
dubbo.registries.registryOther.id=registryOther
dubbo.registries.registryOther.address=zzzz
dubbo.registries.registryOther.file=logs/dubbo-registry-other.properties
dubbo.registries.registryOther.protocol=zookeeper
dubbo.registries.registryOther.register=false
dubbo.registries.registryOther.default=false

dubbo.provider.timeout=30000
dubbo.provider.registryIds=registryMain

dubbo.consumer.id=consumerMain
dubbo.consumer.registryIds=registryMain
dubbo.consumer.timeout=30000
dubbo.consumer.retries=0

dubbo.monitor.protocol=registry

@Reference
private AService beanA;
@Reference(registry = "registryOther", injvm = false, id = "beanB")
private AService beanB;

Will cause unexpected subscription and wrong configuration for beanB.

And setting registryOther both register=false and subscript=false will ignore its initializing.

Same to other kinds of such configuration combinations.

Is that an issue?

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3

Operating System version: win7

Java version: jdk8

Steps to reproduce this issue

write a goole proto file contain bytes list or bytes map.

syntax = "proto2"; package org.apache.dubbo.metadata.definition.protobuf.model; message PBRequestType { optional bytes msg = 7; repeated bytes bytesList = 10; map<string, bytes> bytesMap = 11; }

generate goolgle pb entity and used as service parameter.

add dependency

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>dubbo-metadata-definition-protobuf</artifactId>
</dependency>

service log exception when generate service definition.

see org.apache.dubbo.metadata.definition.protobuf.ProtobufTypeBuilderTest

仓库地址

Some compatibility logic could be added by who want to use the serviceDefinition.

We could use String Value in base64 encoded to transform to bytes property.

Brief changelog

Expected Result

serviceDefinition should be generated successfully.

Actual Result

If there is an exception, please attach the exception trace:

java.lang.IllegalArgumentException: Map protobuf property bytesMapof Type java.util.Map<java.lang.String, com.google.protobuf.ByteString> can't be parsed.Map with unString key or ByteString value is not supported.
at org.apache.dubbo.metadata.definition.protobuf.ProtobufTypeBuilder.validateMapType(ProtobufTypeBuilder.java:164)
at org.apache.dubbo.metadata.definition.protobuf.ProtobufTypeBuilder.buildProtobufTypeDefinition(ProtobufTypeBuilder.java:103)
at org.apache.dubbo.metadata.definition.protobuf.ProtobufTypeBuilder.build(ProtobufTypeBuilder.java:72)
at org.apache.dubbo.metadata.definition.TypeDefinitionBuilder.build(TypeDefinitionBuilder.java:52)
at org.apache.dubbo.metadata.definition.TypeDefinitionBuilder.build(TypeDefinitionBuilder.java:81)
at org.apache.dubbo.metadata.definition.ServiceDefinitionBuilder.build(ServiceDefinitionBuilder.java:77)
at org.apache.dubbo.metadata.definition.ServiceDefinitionBuilder.buildFullDefinition(ServiceDefinitionBuilder.java:50)
at org.apache.dubbo.metadata.definition.protobuf.ProtobufTypeBuilderTest.testProtobufBuilder(ProtobufTypeBuilderTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:184)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:180)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:127)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)