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

Serialization ContentTypeId conflict between avro protocol and protocoluff protocol #3926

Closed
2 tasks done
fitzf opened this issue Apr 24, 2019 · 3 comments
Closed
2 tasks done
Assignees
Labels
type/bug Bugs to being fixed
Milestone

Comments

@fitzf
Copy link
Contributor

fitzf commented Apr 24, 2019

  • 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.2-SNAPSHOT
  • Operating System version: OS X 10.14.4
  • Java version: 1.8.0_202

Steps to reproduce this issue

  1. [DUBBO] Serialization extension org.apache.dubbo.common.serialize.protostuff.ProtostuffSerialization has duplicate id to Serialization extension org.apache.dubbo.common.serialize.avro.AvroSerialization, ignore this Serialization extension
CodecSupport
static {
        Set<String> supportedExtensions = ExtensionLoader.getExtensionLoader(Serialization.class).getSupportedExtensions();
        for (String name : supportedExtensions) {
            Serialization serialization = ExtensionLoader.getExtensionLoader(Serialization.class).getExtension(name);
            byte idByte = serialization.getContentTypeId();
            if (ID_SERIALIZATION_MAP.containsKey(idByte)) {
                logger.error("Serialization extension " + serialization.getClass().getName()
                        + " has duplicate id to Serialization extension "
                        + ID_SERIALIZATION_MAP.get(idByte).getClass().getName()
                        + ", ignore this Serialization extension");
                continue;
            }
            ID_SERIALIZATION_MAP.put(idByte, serialization);
            ID_SERIALIZATIONNAME_MAP.put(idByte, name);
        }
    }

public class ProtostuffSerialization implements Serialization {
    @Override
    public byte getContentTypeId() {
        return 10;
    }
}

public class AvroSerialization implements Serialization {
    @Override
    public byte getContentTypeId() {
        return 10;
    }
}
@fitzf fitzf changed the title ContentTypeId conflict between avro protocol and protocoluff protocol Serialization ContentTypeId conflict between avro protocol and protocoluff protocol Apr 25, 2019
@fitzf
Copy link
Contributor Author

fitzf commented Apr 26, 2019

@ralf0131 @CrazyHZM PLZ

@CrazyHZM
Copy link
Member

My mistake, I will fix it later, thank you.

@CrazyHZM CrazyHZM self-assigned this Apr 26, 2019
@CrazyHZM CrazyHZM added the type/bug Bugs to being fixed label Apr 26, 2019
@beiwei30 beiwei30 added this to the 2.7.2 milestone May 5, 2019
@CrazyHZM CrazyHZM closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

3 participants