You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2020/01/17 07:01:49 UTC
[GitHub] [dubbo] beiwei30 commented on issue #4650: align
ExchangeCodec with DubboCodec
I revisit the current impl of ExchangeCodec, and I believe it's fine, for example:
```java
ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto);
if (status == Response.OK) {
Object data;
if (res.isHeartbeat()) {
data = decodeHeartbeatData(channel, in);
} else if (res.isEvent()) {
data = decodeEventData(channel, in);
} else {
data = decodeResponseData(channel, in, getRequestData(id));
}
res.setResult(data);
} else {
res.setErrorMessage(in.readUTF());
}
```
It is pretty safe to call `CodecSupport.deserialize(channel.getUrl(), is, proto)` at the first place.
[ Full content available at: https://github.com/apache/dubbo/issues/4650 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org