You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "gMan1990 (GitHub)" <gi...@apache.org> on 2018/12/27 04:55:40 UTC

[GitHub] [incubator-dubbo] gMan1990 opened issue #3074: serialization方式不能自定每个Service,可以每个protocol

我就问一下,不行就算了~

---
https://github.com/apache/incubator-dubbo/blob/6ce7b11f982c5f7beb2ac5897fb33d48da357ada/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/codec/ExchangeCodec.java#L211
```java
    protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request req) throws IOException {
        Serialization serialization = getSerialization(channel);
```
dubbo-2.6.3,channel.url对应的service和req里对应的service不是同一个,导致对每个Service配置不同的serialization结果还是同一个serialization方式(看channel拿到的是哪个)

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] gMan1990 commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "gMan1990 (GitHub)" <gi...@apache.org>.
sorry, 我的锅~

---
Q1: dubbo-2.6.3
1. 提供者和消费者不在同一个jvm里,或者强制指定scope="remote"
2. 提供者里为2个service指定不同的```serialization```
3. 消费者里断点到下面这个方法里: ```serialization = getSerialization(channel);```
https://github.com/apache/incubator-dubbo/blob/6ce7b11f982c5f7beb2ac5897fb33d48da357ada/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/codec/ExchangeCodec.java#L211
4. 测试Reference1,断点地方看下channel.url对应的service和req里对应的service是否是同一个
5. 测试Reference2,断点地方看下channel.url对应的service和req里对应的service是否是同一个

想表达的就是上面的:channel.url对应的service和req里对应的service不是同一个

Q2: jackson serialization?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] zonghaishang commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "zonghaishang (GitHub)" <gi...@apache.org>.
@gMan1990 抱歉,没看懂你的提问

针对接口级别设置序列化协议:

![image](https://user-images.githubusercontent.com/15549777/50544975-6a757180-0c41-11e9-9d28-dc5fbd990114.png)

针对协议级别设置序列化协议:

![image](https://user-images.githubusercontent.com/15549777/50544981-7f520500-0c41-11e9-85bc-170fc7524c93.png)

针对应用全局设置序列化协议:

![image](https://user-images.githubusercontent.com/15549777/50544986-9f81c400-0c41-11e9-89e5-5c2d36401cbb.png)



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] zonghaishang commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "zonghaishang (GitHub)" <gi...@apache.org>.
q1:
我的理解,拿到的应该不是同一个service实例,在dubbo最新版本,比如2.6.5& 2.7.0+ 已经修复过一次。低版本拿到的是同一个实例,当时用`@Reference`注解内部使用了cache,导致拿到同一个实例。

q2: jackson serialization?
这个问题是啥?

dubbo 客户端请求会把具体序列化协议flag传给provider,如果遇到具体的问题,麻烦写个demo复现,我们看下。

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] beiwei30 closed issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
[ issue closed by beiwei30 ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] beiwei30 commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
for json, we support fastjson serialization.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] beiwei30 commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "beiwei30 (GitHub)" <gi...@apache.org>.
i consider this topic can be closed now.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] gMan1990 commented on issue #3074: serialization方式不能自定每个Service,可以每个protocol

Posted by "gMan1990 (GitHub)" <gi...@apache.org>.
sorry, 我的锅~

---
Q1: dubbo-2.6.3
1. 提供者和消费者不在同一个jvm里,或者强制指定scope="remote"
2. 提供者里为2个service指定不同的```serialization```
3. 消费者里断点到下面这个方法里: ```serialization = getSerialization(channel);```
https://github.com/apache/incubator-dubbo/blob/6ce7b11f982c5f7beb2ac5897fb33d48da357ada/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/codec/ExchangeCodec.java#L211
4. 测试Reference1,断点地方看下channel.url对应的service和req里对应的service是否是同一个
5. 测试Reference2,断点地方看下channel.url对应的service和req里对应的service是否是同一个
reference1,reference2对应两个不同的service

想表达的就是上面的:channel.url对应的service和req里对应的service不是同一个

Q2: jackson serialization?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3074 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org