dubbo 协议

doctorvian 2017-12-06

encode

onetoone

org.jboss.netty.handler.codec.oneone.OneToOneEncoder

com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter.InternalEncoder

org.jboss.netty.handler.codec.base64.Base64Encoder

org.jboss.netty.handler.codec.marshalling.CompatibleMarshallingEncoder

org.jboss.netty.handler.codec.serialization.CompatibleObjectEncoder

org.jboss.netty.handler.codec.http.HttpClientCodec.Encoder

org.jboss.netty.handler.codec.http.HttpMessageEncoder

org.jboss.netty.handler.codec.http.HttpRequestEncoder

org.jboss.netty.handler.codec.http.HttpResponseEncoder

org.jboss.netty.handler.codec.compression.JdkZlibEncoder

org.jboss.netty.handler.codec.frame.LengthFieldPrepender

org.jboss.netty.handler.codec.marshalling.MarshallingEncoder

org.jboss.netty.handler.codec.serialization.ObjectEncoder

org.jboss.netty.handler.codec.oneone.OneToOneStrictEncoder

org.jboss.netty.handler.codec.protobuf.ProtobufEncoder

org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender

org.jboss.resteasy.plugins.server.netty.RestEasyHttpResponseEncoder

org.jboss.netty.handler.codec.rtsp.RtspMessageEncoder

org.jboss.netty.handler.codec.rtsp.RtspRequestEncoder

org.jboss.netty.handler.codec.rtsp.RtspResponseEncoder

org.jboss.netty.handler.codec.socks.SocksMessageEncoder

org.jboss.netty.handler.codec.string.StringEncoder

org.jboss.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder

org.jboss.netty.handler.codec.http.websocketx.WebSocket07FrameEncoder

org.jboss.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder

org.jboss.netty.handler.codec.http.websocketx.WebSocket13FrameEncoder

org.jboss.netty.handler.codec.http.websocket.WebSocketFrameEncoder

org.jboss.netty.handler.codec.compression.ZlibEncoder

codec

com.alibaba.dubbo.remoting.Codec2

com.alibaba.dubbo.remoting.transport.AbstractCodec

com.alibaba.dubbo.remoting.transport.codec.CodecAdapter

com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec

com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec

com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec

com.alibaba.dubbo.remoting.telnet.codec.TelnetCodec

com.alibaba.dubbo.rpc.protocol.thrift.ThriftCodec

com.alibaba.dubbo.rpc.protocol.thrift.ThriftNativeCodec

com.alibaba.dubbo.remoting.transport.codec.TransportCodec

com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec

<16bytesheader><nbytesbody>

头部

<2bytesmagic><1byte消息类型标志orserializationcontent-type-id><1bytereserved><8bytes消息Id><4bytes消息长度>

魔数

0xdabb

body

<nbytesdubboversion><nbytespath><nbytesversion><nbytesmethodname><4bytes->-1|4bytesargumenttypeslength|nbytesargumenttypes><nbytesarguments><nbytesattachments>

dubboversion//2.0.0

<1byte>->128

<1byte>->129

<nbytesdubboversion>//不记录长度,1<字符串长度<64并且其中的每一个字符都在ascii字母表范围中。

<1bytedubboversionlength><nbytesdubboversion>

<2bytedubboversionlength><nbytesdubboversion>

<3bytedubboversionlength><nbytesdubboversion>

<4bytedubboversionlength><nbytesdubboversion>

<5bytedubboversionlength><nbytesdubboversion>

path//com.alibaba.dubbo.demo.TestService

version//

argumenttypes//

例如:I,J,F,D,V,[I,[J,[F,[D,[V,Ljava/lang/String;,[Ljava/lang/String;,Ljava/lang/String;[J,......

消息长度

body长度

com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec

<16bytesheader><nbytesbody>

头部

<2bytesmagic><1byte消息类型标志orserializationcontent-type-id><1bytereserved><8bytes消息Id><4bytes消息长度>

魔数

0xdabb

body

<nbytesdubboversion><nbytespath><nbytesversion><nbytesmethodname><4bytes->-1|4bytesargumenttypeslength|nbytesargumenttypes><nbytesarguments><nbytesattachments>

dubboversion//2.0.0

<1byte>->128

<1byte>->129

<nbytesdubboversion>//不记录长度,1<字符串长度<64并且其中的每一个字符都在ascii字母表范围中。

<1bytedubboversionlength><nbytesdubboversion>

<2bytedubboversionlength><nbytesdubboversion>

<3bytedubboversionlength><nbytesdubboversion>

<4bytedubboversionlength><nbytesdubboversion>

<5bytedubboversionlength><nbytesdubboversion>

path//com.alibaba.dubbo.demo.TestService

version//

argumenttypes//

例如:I,J,F,D,V,[I,[J,[F,[D,[V,Ljava/lang/String;,[Ljava/lang/String;,Ljava/lang/String;[J,......

消息长度

body长度

payload

Datalengthtoolarge:241,maxpayload:8388608,channel:NettyChannel[channel=[id:0xf777da5d,/192.168.1.10:54085:>/192.168.1.10:20880]]

消息类型标志

消息类型FLAG

REQUEST0x8010000000

TWOWAY0x4001000000

EVENT0x2000100000

com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec

序列化

com.alibaba.dubbo.common.serialize.Serialization

com.alibaba.dubbo.common.serialize.support.kryo.KryoSerialization

META-INF/dubbo/internal/com.alibaba.dubbo.common.serialize.Serialization

dubbo=com.alibaba.dubbo.common.serialize.support.dubbo.DubboSerialization

hessian2=com.alibaba.dubbo.common.serialize.support.hessian.Hessian2Serialization

java=com.alibaba.dubbo.common.serialize.support.java.JavaSerialization

compactedjava=com.alibaba.dubbo.common.serialize.support.java.CompactedJavaSerialization

json=com.alibaba.dubbo.common.serialize.support.json.JsonSerialization

fastjson=com.alibaba.dubbo.common.serialize.support.json.FastJsonSerialization

nativejava=com.alibaba.dubbo.common.serialize.support.nativejava.NativeJavaSerialization

kryo=com.alibaba.dubbo.common.serialize.support.kryo.KryoSerialization

fst=com.alibaba.dubbo.common.serialize.support.fst.FstSerialization

jackson=com.alibaba.dubbo.common.serialize.support.json.JacksonSerialization

SerializationContent-Type

Content-TypeContent-Type-IdSerialization

dubbox-application/dubbo1DubboSerialization

hessian2x-application/hessian22Hessian2Serialization

javax-application/java3JavaSerialization

compactedjavax-application/compactedjava4CompactedJavaSerialization

jsontext/json5JsonSerialization

fastjsontext/json6FastJsonSerialization

nativejavax-application/nativejava7NativeJavaSerialization

kryox-application/kryo8KryoSerialization

fstx-application/fst9FstSerialization

jacksontext/json20JacksonSerialization

相关推荐