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

bolt为什么不支持自己扩展序列化方式? #504

Closed
minli04g opened this issue Jan 28, 2019 · 4 comments
Closed

bolt为什么不支持自己扩展序列化方式? #504

minli04g opened this issue Jan 28, 2019 · 4 comments
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@minli04g
Copy link
Contributor

Your question

describe your question clearly

Your scenes

describe your use scenes (why need this feature)

Your advice

describe the advice or solution you'd like

Environment

  • SOFARPC version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@leizhiyuan
Copy link
Contributor

如果你说的是rpc的。com.alipay.sofa.rpc.codec.AbstractSerializer 实现这个抽象类就可以。

如果是直接使用了bolt,可以提给bolt的同学。

@leizhiyuan leizhiyuan added the question Further information is requested label Jan 28, 2019
@minli04g
Copy link
Contributor Author

BoltClientProxyInvoker.java
中,parseSerializeType对于其他类型序列化直接抛出异常了, 应该调用super.parseSerializeType

@Override
protected Byte parseSerializeType(String serialization) {
    Byte serializeType;
    if (SERIALIZE_HESSIAN.equals(serialization)
        || SERIALIZE_HESSIAN2.equals(serialization)) {
        serializeType = RemotingConstants.SERIALIZE_CODE_HESSIAN;
    } else if (SERIALIZE_PROTOBUF.equals(serialization)) {
        serializeType = RemotingConstants.SERIALIZE_CODE_PROTOBUF;
    } else if (SERIALIZE_JAVA.equals(serialization)) {
        serializeType = RemotingConstants.SERIALIZE_CODE_JAVA;
    } else {
        serializeType = super.parseSerializeType(serialization);
    }
    return serializeType;
}

@khotyn
Copy link
Member

khotyn commented Jan 28, 2019

@dbl-x 帮忙看一下哦~

@leizhiyuan
Copy link
Contributor

这个在群里沟通过了。@minli04g 辛苦提个mr来改一下。

@leizhiyuan leizhiyuan added this to the 5.5.1 milestone Jan 28, 2019
@leizhiyuan leizhiyuan added the enhancement New feature or request label Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants