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

[DUBBO-3537]: dubbox升级dubbo版本的兼容性问题 #3996

Merged
merged 1 commit into from
May 8, 2019
Merged

[DUBBO-3537]: dubbox升级dubbo版本的兼容性问题 #3996

merged 1 commit into from
May 8, 2019

Conversation

beiwei30
Copy link
Member

@beiwei30 beiwei30 commented May 8, 2019

What is the purpose of the change

fix #3537

Brief changelog

XXXXX

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@chickenlj chickenlj merged commit 5fd41d7 into apache:master May 8, 2019
@codecov-io
Copy link

Codecov Report

Merging #3996 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3996      +/-   ##
============================================
- Coverage     63.66%   63.65%   -0.01%     
+ Complexity      566      565       -1     
============================================
  Files           748      748              
  Lines         32309    32311       +2     
  Branches       5134     5135       +1     
============================================
- Hits          20569    20568       -1     
- Misses         9381     9382       +1     
- Partials       2359     2361       +2
Impacted Files Coverage Δ Complexity Δ
...src/main/java/org/apache/dubbo/common/Version.java 61.05% <0%> (-1.32%) 0 <0> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 67.39% <0%> (-4.35%) 0% <0%> (ø)
...pache/dubbo/registry/support/AbstractRegistry.java 80.07% <0%> (-1.54%) 0% <0%> (ø)
...che/dubbo/remoting/transport/mina/MinaChannel.java 53.94% <0%> (-1.32%) 17% <0%> (-1%)
...dubbo/remoting/exchange/support/DefaultFuture.java 74.14% <0%> (ø) 0% <0%> (ø) ⬇️
.../java/org/apache/dubbo/config/ReferenceConfig.java 59.85% <0%> (+0.36%) 0% <0%> (ø) ⬇️
...ache/dubbo/remoting/p2p/support/AbstractGroup.java 56.81% <0%> (+11.36%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 455d29a...65d7100. Read the comment docs.

@kun-song
Copy link
Contributor

kun-song commented May 8, 2019

合入该 PR 后,Dubbox 和 Dubbo 就可以兼容了吗? @beiwei30

@chickenlj
Copy link
Contributor

@satansk 要做到和dubbox兼容,恐怕还有一个地方需要做,dubbox直接修改了原生rpc协议编码
https://github.com/dangdangdotcom/dubbox/blob/master/dubbo-rpc/dubbo-rpc-default/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java#L187

@morisenmen
Copy link

morisenmen commented Oct 13, 2019

我们使用的方案,可供大家参考实现,自定义SPI扩展Codec2,DubboCountCodec,DubboCodec
这两个类,DubboCountCodec引用自定义的DubboCodec,重写encodeResponseData方法,attach判断处理兼容dubbox,本身这个attach判断就是一件兼容处理了dubbox,但是dubbox实现的bug,版本号应该为2.0.0的,invoker的URL传递的是2.8.4,因此这个判断不包含。
扩展实现配置的时候配置自己实现类为dubbo的spi扩展即可
即META-INF/dubbo/internal下面配置扩展[com.alibaba.dubbo/ore.apacha.dubbo].remoting.Codec2
中配置dubbo=自己实现类DubboCountCodec全路径类名即可
该方案只对升级版本的provider做处理,老版本的dubbox完全不需要任何处理
本身可以通过配置实现该功能的,但是dubbo中还有一些bug,可以参考Codec设置的bug说明,我也有备注 #4628
这里还有一个问题,上面写的配置路径不能使用SPI扩展的注解实现,因为这个是替换官方实现的dubbo配置,如果是没有codec设置的bug,则可以使用SPI注解命名,配合ProtocolConfig.setCodec实现,或者配置目录可以是扩展配置路径META-INF/dubbo而不需要再增加internal目录

@neeuq
Copy link

neeuq commented Dec 13, 2019

@morisenmen 如果在META-INF/dubbo/internal下面配置扩展[com.alibaba.dubbo/ore.apacha.dubbo].remoting.Codec2
中配置dubbo=自己实现类DubboCountCodec全路径类名,是通过java.lang.ClassLoader#getResources来保证自己实现的类优先加载吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dubbox升级dubbo版本的兼容性问题
6 participants