This is an automated email from the ASF dual-hosted git repository. victory pushed a commit to branch 2.6.7-release in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/2.6.7-release by this push: new 0ea3e28 [Dubbo-4525] same as #4533, fix ClusterUtils.mergeUrl (#4540) 0ea3e28 is described below commit 0ea3e280aa9835e27cfb1f13d9684ced76132364 Author: ken.lj <ken.lj...@gmail.com> AuthorDate: Fri Jul 12 09:52:21 2019 +0800 [Dubbo-4525] same as #4533, fix ClusterUtils.mergeUrl (#4540) --- .../com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java | 11 +++++++++-- .../com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java | 13 +++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java index 7bc6f30..26d1f25 100644 --- a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java +++ b/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java @@ -18,6 +18,7 @@ package com.alibaba.dubbo.rpc.cluster.support; import com.alibaba.dubbo.common.Constants; import com.alibaba.dubbo.common.URL; +import com.alibaba.dubbo.common.utils.StringUtils; import java.util.HashMap; import java.util.Map; @@ -88,18 +89,24 @@ public class ClusterUtils { if (remoteTimestamp != null && remoteTimestamp.length() > 0) { map.put(Constants.REMOTE_TIMESTAMP_KEY, remoteMap.get(Constants.TIMESTAMP_KEY)); } + String tag = remoteMap.get(Constants.TAG_KEY); + if (StringUtils.isNotEmpty(tag)) { + map.put(Constants.TAG_KEY, tag); + } else { + map.remove(Constants.TAG_KEY); + } // Combine filters and listeners on Provider and Consumer String remoteFilter = remoteMap.get(Constants.REFERENCE_FILTER_KEY); String localFilter = localMap.get(Constants.REFERENCE_FILTER_KEY); if (remoteFilter != null && remoteFilter.length() > 0 && localFilter != null && localFilter.length() > 0) { - localMap.put(Constants.REFERENCE_FILTER_KEY, remoteFilter + "," + localFilter); + map.put(Constants.REFERENCE_FILTER_KEY, remoteFilter + "," + localFilter); } String remoteListener = remoteMap.get(Constants.INVOKER_LISTENER_KEY); String localListener = localMap.get(Constants.INVOKER_LISTENER_KEY); if (remoteListener != null && remoteListener.length() > 0 && localListener != null && localListener.length() > 0) { - localMap.put(Constants.INVOKER_LISTENER_KEY, remoteListener + "," + localListener); + map.put(Constants.INVOKER_LISTENER_KEY, remoteListener + "," + localListener); } } diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java index b159191..3c12448 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java @@ -22,7 +22,6 @@ import com.alibaba.dubbo.common.io.Bytes; import com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream; import com.alibaba.dubbo.common.logger.Logger; import com.alibaba.dubbo.common.logger.LoggerFactory; -import com.alibaba.dubbo.common.serialize.ObjectInput; import com.alibaba.dubbo.common.serialize.ObjectOutput; import com.alibaba.dubbo.common.utils.ReflectUtils; import com.alibaba.dubbo.common.utils.StringUtils; @@ -73,13 +72,12 @@ public class DubboCodec extends ExchangeCodec implements Codec2 { byte status = header[3]; res.setStatus(status); try { - ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto); if (status == Response.OK) { Object data; if (res.isHeartbeat()) { - data = decodeHeartbeatData(channel, in); + data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto)); } else if (res.isEvent()) { - data = decodeEventData(channel, in); + data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto)); } else { DecodeableRpcResult result; if (channel.getUrl().getParameter( @@ -97,7 +95,7 @@ public class DubboCodec extends ExchangeCodec implements Codec2 { } res.setResult(data); } else { - res.setErrorMessage(in.readUTF()); + res.setErrorMessage(CodecSupport.deserialize(channel.getUrl(), is, proto).readUTF()); } } catch (Throwable t) { if (log.isWarnEnabled()) { @@ -117,11 +115,10 @@ public class DubboCodec extends ExchangeCodec implements Codec2 { } try { Object data; - ObjectInput in = CodecSupport.deserialize(channel.getUrl(), is, proto); if (req.isHeartbeat()) { - data = decodeHeartbeatData(channel, in); + data = decodeHeartbeatData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto)); } else if (req.isEvent()) { - data = decodeEventData(channel, in); + data = decodeEventData(channel, CodecSupport.deserialize(channel.getUrl(), is, proto)); } else { DecodeableRpcInvocation inv; if (channel.getUrl().getParameter(