從 dubbo 2.6.5 升級到 2.7.0,忽然發現好多地方不能用了,dubbo:annotation 直接報紅,原先的 @Service 和 @Reference 中直接報了過期,源碼裏面也沒有告知替代的類,真是耍流氓。。html
Dubbo 2.7.0 添加了異步化支持。異步化支持再也不侷限於基於 Future 接口的異步,也再也不僅僅侷限於只能在客戶端異步。具體來講,Dubbo 2.7.0 版本全面擁抱 JDK8,在客戶端開始支持基於 CompletableFuture 的異步編程範式,在服務端支持基於 AsyncContext 的異步模型。spring
Dubbo 2.7.0 中,經過對 URL 的改造,將註冊中心拆分紅了三個中心,分別是註冊中心、配置中心和元數據中心,三者各司其責,不只有效地解決了上述容量問題,並且很好地適應了微服務的技術架構,用戶能夠開始自由選擇適合本身場景的註冊中心和配置中心。apache
Dubbo 2.7.0 版本在改造的過程當中遵循了一個原則,即保持與低版本的兼容性,所以從功能層面來講它是與2.6.x及更低版本徹底兼容的。編程
官方 Dubbo 2.7.0 的說明文檔:http://dubbo.incubator.apache.org/zh-cn/docs/user/versions/version-270.html架構
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo" xmlns="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> <!-- dubbo 配置 --> <dubbo:application name="ts_provider_common"/> <dubbo:registry address="${zookeeper.host}" simplified="true"/> <dubbo:protocol name="dubbo" port="-1"/> <dubbo:provider timeout="3000" retries="0"/> <dubbo:consumer check="false"/> <dubbo:annotation package="com.demo"/> </beans>