Skip to content
Permalink
Browse files

Merge branch 'master' of https://github.com/apache/dubbo-go

  • Loading branch information...
AlexStocks committed Sep 30, 2019
2 parents 3d3dd8e + edcdbd9 commit ad63215e29b238dddfe5900efdc073c2d4d6bcca
Showing with 6,055 additions and 5,196 deletions.
  1. +8 −2 .gitignore
  2. +26 −0 CHANGE.md
  3. +0 −1 LICENSE
  4. +17 −7 README.md
  5. +18 −8 README_CN.md
  6. +5 −0 before_ut.bat
  7. +4 −0 before_ut.sh
  8. +8 −4 cluster/cluster_impl/failback_cluster_invoker.go
  9. +14 −4 cluster/cluster_impl/failover_cluster_invoker.go
  10. +4 −4 cluster/cluster_impl/failover_cluster_test.go
  11. +3 −0 cluster/directory/base_directory.go
  12. +0 −1 cluster/loadbalance/least_active.go
  13. +17 −0 cluster/loadbalance/round_robin_test.go
  14. +31 −11 common/config/environment.go
  15. +2 −1 common/config/environment_test.go
  16. +29 −10 common/constant/default.go
  17. +31 −17 common/constant/key.go
  18. +60 −0 common/extension/configurator.go
  19. +17 −0 common/extension/router_factory.go
  20. +92 −2 common/proxy/proxy_factory/default.go
  21. +149 −47 common/url.go
  22. +45 −18 common/url_test.go
  23. +60 −20 common/utils/net.go
  24. +17 −1 config/application_config.go
  25. +109 −25 config/base_config.go
  26. +263 −11 config/base_config_test.go
  27. +26 −10 config/config_center_config.go
  28. +20 −1 config/config_loader.go
  29. +91 −4 config/config_loader_test.go
  30. +1 −0 config/config_utils.go
  31. +17 −1 config/consumer_config.go
  32. +16 −1 config/method_config.go
  33. +1 −0 config/protocol_config.go
  34. +15 −1 config/provider_config.go
  35. +33 −0 config/provider_config_test.go
  36. +15 −6 config/reference_config.go
  37. +57 −13 config/reference_config_test.go
  38. +44 −20 config/registry_config.go
  39. +5 −1 config/registry_config_test.go
  40. +20 −8 config/service_config.go
  41. +55 −12 config/service_config_test.go
  42. +2 −2 config/testdata/consumer_config.yml
  43. +3 −1 config/testdata/consumer_config_with_configcenter.yml
  44. +24 −29 ...dubbo/go-client/profiles/release/client.yml → config/testdata/consumer_config_withoutProtocol.yml
  45. +1 −1 config/testdata/provider_config.yml
  46. +21 −36 ...dubbo/go-server/profiles/release/server.yml → config/testdata/provider_config_withoutProtocol.yml
  47. +40 −0 config_center/configuration_listener.go
  48. +0 −24 config_center/configuration_parser.go
  49. +0 −16 config_center/configuration_parser_test.go
  50. +8 −3 ...center/zookeeper/dubbo/with-configcenter-go-server/app/version.go → config_center/configurator.go
  51. +41 −0 config_center/configurator/mock.go
  52. +131 −0 config_center/configurator/override.go
  53. +77 −0 config_center/configurator/override_test.go
  54. +6 −5 config_center/dynamic_configuration.go
  55. +70 −13 config_center/mock_dynamic_config.go
  56. +251 −0 config_center/parser/configuration_parser.go
  57. +34 −0 config_center/parser/configuration_parser_test.go
  58. +3 −1 config_center/zookeeper/factory.go
  59. +8 −6 config_center/zookeeper/impl.go
  60. +3 −3 config_center/zookeeper/impl_test.go
  61. +9 −7 config_center/zookeeper/listener.go
  62. +44 −38 examples/README.md
  63. +0 −152 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/app/client.go
  64. +1 −1 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/profiles/dev/client.yml
  65. +0 −28 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/profiles/dev/log.yml
  66. +0 −38 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/profiles/release/client.yml
  67. +0 −28 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/profiles/release/log.yml
  68. +0 −38 examples/configcenter/zookeeper/dubbo/with-configcenter-go-client/profiles/test/client.yml
  69. +0 −192 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/app/user.go
  70. +0 −151 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/bin/load.sh
  71. +0 −23 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/common/app.properties
  72. +0 −80 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/common/build.sh
  73. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/linux/dev.sh
  74. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/linux/release.sh
  75. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/linux/test.sh
  76. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/mac/dev.sh
  77. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/mac/release.sh
  78. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/mac/test.sh
  79. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/windows/dev.sh
  80. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/windows/release.sh
  81. +0 −36 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/assembly/windows/test.sh
  82. +1 −1 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/profiles/dev/server.yml
  83. +0 −28 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/profiles/release/log.yml
  84. +0 −39 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/profiles/release/server.yml
  85. +0 −39 examples/configcenter/zookeeper/dubbo/with-configcenter-go-server/profiles/test/server.yml
  86. +0 −137 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/app/client.go
  87. +0 −63 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/app/user.go
  88. +0 −203 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/bin/load.sh
  89. +0 −23 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/common/app.properties
  90. +0 −83 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/common/build.sh
  91. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/linux/dev.sh
  92. +0 −35 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/linux/release.sh
  93. +0 −35 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/linux/test.sh
  94. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/mac/dev.sh
  95. +0 −34 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/mac/release.sh
  96. +0 −34 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/mac/test.sh
  97. +0 −34 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/windows/dev.sh
  98. +0 −34 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/windows/release.sh
  99. +0 −34 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/assembly/windows/test.sh
  100. +0 −16 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/dev/client.yml
  101. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/dev/log.yml
  102. +0 −16 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/release/client.yml
  103. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/release/log.yml
  104. +0 −16 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/test/client.yml
  105. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-client/profiles/test/log.yml
  106. +0 −155 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/app/user.go
  107. +0 −151 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/bin/load.sh
  108. +0 −23 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/common/app.properties
  109. +0 −80 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/common/build.sh
  110. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/linux/dev.sh
  111. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/linux/release.sh
  112. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/linux/test.sh
  113. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/mac/dev.sh
  114. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/mac/release.sh
  115. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/mac/test.sh
  116. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/windows/dev.sh
  117. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/windows/release.sh
  118. +0 −36 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/assembly/windows/test.sh
  119. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/dev/log.yml
  120. +0 −22 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/dev/server.yml
  121. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/release/log.yml
  122. +0 −25 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/release/server.yml
  123. +0 −28 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/test/log.yml
  124. +0 −25 examples/configcenter/zookeeper/jsonrpc/with-configcenter-go-server/profiles/test/server.yml
  125. +44 −0 examples/consul/README.md
  126. +43 −0 examples/consul/go-client/client.go
  127. +17 −20 examples/{generic/go-client/profiles/test → consul/go-client/config}/client.yml
  128. 0 ...nter/zookeeper/dubbo/with-configcenter-go-client/profiles/test → consul/go-client/config}/log.yml
  129. +16 −2 ...enter/zookeeper/jsonrpc/with-configcenter-go-client/app/version.go → consul/go-client/service.go}
  130. 0 ...nter/zookeeper/dubbo/with-configcenter-go-server/profiles/test → consul/go-server/config}/log.yml
  131. +10 −20 examples/{helloworld/dubbo/go-server/profiles/release → consul/go-server/config}/server.yml
  132. +4 −9 ...les/{configcenter/zookeeper/jsonrpc/with-configcenter-go-server/app → consul/go-server}/server.go
  133. +36 −0 examples/consul/go-server/service.go
  134. +7 −0 examples/consul/java-client/.gitignore
  135. +88 −0 examples/consul/java-client/pom.xml
  136. +22 −22 ...configcenter-go-server/app/version.go → consul/java-client/src/main/java/dubbo/DubboService.java}
  137. +43 −0 examples/consul/java-client/src/main/java/dubbo/client/Main.java
  138. +4 −0 examples/consul/java-client/src/main/resources/log4j.properties
  139. +7 −0 examples/consul/java-server/.gitignore
  140. +89 −0 examples/consul/java-server/pom.xml
  141. +5 −0 examples/consul/java-server/src/main/java/dubbo/DubboService.java
  142. +11 −0 examples/consul/java-server/src/main/java/dubbo/server/Impl/DubboServiceImpl.java
  143. +53 −0 examples/consul/java-server/src/main/java/dubbo/server/Main.java
  144. +4 −0 examples/consul/java-server/src/main/resources/log4j.properties
  145. +15 −15 examples/general/dubbo/go-client/app/client.go
  146. +4 −4 examples/general/dubbo/go-client/profiles/dev/client.yml
  147. +0 −28 examples/general/dubbo/go-client/profiles/release/log.yml
  148. +0 −28 examples/general/dubbo/go-client/profiles/test/log.yml
  149. +1 −1 examples/general/dubbo/go-server/app/server.go
  150. +4 −4 examples/general/dubbo/go-server/profiles/dev/server.yml
  151. +0 −28 examples/general/dubbo/go-server/profiles/release/log.yml
  152. +0 −28 examples/general/dubbo/go-server/profiles/test/log.yml
  153. +0 −91 examples/general/dubbo/go-server/profiles/test/server.yml
  154. +1 −0 examples/general/dubbo/java-client/src/main/java/com/ikurento/user/UserProvider.java
  155. +2 −0 examples/general/dubbo/java-client/src/main/resources/META-INF/spring/dubbo.consumer.xml
  156. +1 −0 examples/general/dubbo/java-client/src/main/resources/META-INF/spring/service.xml
  157. +0 −1 examples/general/dubbo/java-server/pom.xml
  158. +0 −1 examples/general/dubbo/java-server/src/main/java/com/ikurento/user/UserProviderImpl.java
  159. +2 −2 examples/general/jsonrpc/go-client/app/client.go
  160. +4 −4 examples/general/jsonrpc/go-client/profiles/dev/client.yml
  161. +0 −60 examples/general/jsonrpc/go-client/profiles/release/client.yml
  162. +0 −28 examples/general/jsonrpc/go-client/profiles/release/log.yml
  163. +0 −60 examples/general/jsonrpc/go-client/profiles/test/client.yml
  164. +0 −28 examples/general/jsonrpc/go-client/profiles/test/log.yml
  165. +1 −1 examples/general/jsonrpc/go-server/app/server.go
  166. +4 −4 examples/general/jsonrpc/go-server/profiles/dev/server.yml
  167. +0 −28 examples/general/jsonrpc/go-server/profiles/release/log.yml
  168. +0 −75 examples/general/jsonrpc/go-server/profiles/release/server.yml
  169. +0 −28 examples/general/jsonrpc/go-server/profiles/test/log.yml
  170. +0 −75 examples/general/jsonrpc/go-server/profiles/test/server.yml
  171. +0 −4 examples/generic/go-client/app/client.go
  172. +0 −17 examples/generic/go-client/app/user.go
  173. +0 −1 examples/generic/go-client/assembly/bin/load.sh
  174. +1 −0 examples/generic/go-client/assembly/common/app.properties
  175. +1 −0 examples/generic/go-client/assembly/common/build.sh
  176. +0 −1 examples/generic/go-client/assembly/linux/dev.sh
  177. +0 −1 examples/generic/go-client/assembly/mac/dev.sh
  178. +1 −0 examples/generic/go-client/assembly/mac/test.sh
  179. +1 −1 examples/generic/go-client/profiles/dev/client.yml
  180. +0 −55 examples/generic/go-client/profiles/release/client.yml
  181. +0 −28 examples/generic/go-client/profiles/release/log.yml
  182. +0 −28 examples/generic/go-client/profiles/test/log.yml
  183. +0 −1 examples/generic/java-server/script/debug.sh
  184. +1 −0 examples/generic/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
  185. +0 −1 examples/helloworld/dubbo/go-client/assembly/bin/load.sh
  186. +1 −0 examples/helloworld/dubbo/go-client/assembly/common/app.properties
  187. +1 −0 examples/helloworld/dubbo/go-client/assembly/common/build.sh
  188. +0 −1 examples/helloworld/dubbo/go-client/assembly/linux/release.sh
  189. +0 −1 examples/helloworld/dubbo/go-client/assembly/linux/test.sh
  190. +1 −1 examples/helloworld/dubbo/go-client/assembly/windows/dev.sh
  191. +2 −2 examples/helloworld/dubbo/go-client/profiles/dev/client.yml
  192. +0 −60 examples/helloworld/dubbo/go-client/profiles/release/client.yml
  193. +0 −28 examples/helloworld/dubbo/go-client/profiles/release/log.yml
  194. +0 −59 examples/helloworld/dubbo/go-client/profiles/test/client.yml
  195. +0 −28 examples/helloworld/dubbo/go-client/profiles/test/log.yml
  196. +1 −1 examples/helloworld/dubbo/go-server/app/server.go
  197. +0 −1 examples/helloworld/dubbo/go-server/assembly/bin/load.sh
  198. +3 −2 examples/helloworld/dubbo/go-server/profiles/dev/server.yml
  199. +0 −28 examples/helloworld/dubbo/go-server/profiles/release/log.yml
  200. +0 −28 examples/helloworld/dubbo/go-server/profiles/test/log.yml
  201. +0 −62 examples/helloworld/dubbo/go-server/profiles/test/server.yml
  202. +1 −0 examples/helloworld/dubbo/java-server/src/main/assembly/assembly.xml
  203. +1 −0 examples/helloworld/dubbo/java-server/src/main/resources/META-INF/spring/dubbo.provider.xml
  204. +49 −37 ...-configcenter-go-server/app/server.go → hystrixfilter/dubbo/with-hystrix-go-client/app/client.go}
  205. +80 −0 examples/hystrixfilter/dubbo/with-hystrix-go-client/app/example_fallback_filter.go
  206. +38 −2 ...eeper/dubbo/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/app/user.go
  207. 0 ...er/dubbo/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/app/version.go
  208. 0 ...bo/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/bin/load.sh
  209. 0 ...nfigcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/common/app.properties
  210. 0 ...ith-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/common/build.sh
  211. 0 ...o/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/linux/dev.sh
  212. 0 ...th-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/linux/release.sh
  213. 0 .../with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/linux/test.sh
  214. 0 ...bbo/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/mac/dev.sh
  215. 0 ...with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/mac/release.sh
  216. 0 ...bo/with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/mac/test.sh
  217. 0 ...with-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/windows/dev.sh
  218. 0 ...-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/windows/release.sh
  219. 0 ...ith-configcenter-go-client → hystrixfilter/dubbo/with-hystrix-go-client}/assembly/windows/test.sh
  220. +38 −23 ...bbo/go-client/profiles/test → hystrixfilter/dubbo/with-hystrix-go-client/profiles/dev}/client.yml
  221. +28 −28 ...bo/with-configcenter-go-server → hystrixfilter/dubbo/with-hystrix-go-client}/profiles/dev/log.yml
  222. +0 −1 filter/impl/active_filter.go
  223. +2 −1 filter/impl/echo_filter.go
  224. +13 −5 filter/impl/generic_filter.go
  225. +32 −0 filter/impl/generic_filter_test.go
  226. +269 −0 filter/impl/hystrix_filter.go
  227. +217 −0 filter/impl/hystrix_filter_test.go
  228. +66 −0 filter/impl/token_filter.go
  229. +85 −0 filter/impl/token_filter_test.go
  230. +8 −4 go.mod
  231. +340 −2 go.sum
  232. +48 −19 protocol/dubbo/client.go
  233. +24 −16 protocol/dubbo/client_test.go
  234. +6 −6 protocol/dubbo/codec.go
  235. +2 −2 protocol/dubbo/codec_test.go
  236. +15 −4 protocol/dubbo/dubbo_invoker.go
  237. +4 −3 protocol/dubbo/dubbo_invoker_test.go
  238. +4 −1 protocol/dubbo/dubbo_protocol.go
  239. +1 −1 protocol/dubbo/dubbo_protocol_test.go
  240. +30 −102 protocol/dubbo/listener.go
  241. +48 −22 protocol/dubbo/pool.go
  242. +13 −9 protocol/dubbo/readwriter.go
  243. +1 −1 protocol/dubbo/server.go
  244. +4 −1 protocol/jsonrpc/http_test.go
  245. +4 −1 protocol/jsonrpc/jsonrpc_invoker_test.go
  246. +7 −98 protocol/jsonrpc/server.go
  247. +1 −1 protocol/protocolwrapper/protocol_filter_wrapper.go
  248. +31 −3 protocol/protocolwrapper/protocol_filter_wrapper_test.go
  249. +0 −1 protocol/{RpcStatus.go → rpc_status.go}
  250. +99 −0 registry/base_configuration_listener.go
  251. +206 −0 registry/consul/listener.go
  252. +33 −0 registry/consul/listener_test.go
  253. +184 −0 registry/consul/registry.go
  254. +57 −0 registry/consul/registry_test.go
  255. +117 −0 registry/consul/utils.go
  256. +226 −0 registry/consul/utils_test.go
  257. +132 −65 registry/directory/directory.go
  258. +83 −15 registry/directory/directory_test.go
  259. +13 −6 registry/etcdv3/listener.go
  260. +2 −1 registry/etcdv3/listener_test.go
  261. +47 −7 registry/etcdv3/registry.go
  262. +3 −3 registry/etcdv3/registry_test.go
  263. +40 −1 registry/mock_registry.go
  264. +7 −6 registry/nacos/listener.go
  265. +48 −6 registry/nacos/registry.go
  266. +5 −5 registry/nacos/registry_test.go
  267. +231 −25 registry/protocol/protocol.go
  268. +112 −7 registry/protocol/protocol_test.go
  269. +13 −2 registry/registry.go
  270. +9 −6 registry/zookeeper/listener.go
  271. +27 −3 registry/zookeeper/listener_test.go
  272. +46 −10 registry/zookeeper/registry.go
  273. +3 −3 registry/zookeeper/registry_test.go
  274. +1 −1 remoting/etcdv3/listener.go
  275. +4 −16 remoting/listener.go
  276. +16 −18 remoting/zookeeper/listener.go
  277. +2 −0 remoting/zookeeper/listener_test.go
@@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
*.jar

# Test binary, build with `go test -c`
*.test
@@ -17,10 +18,15 @@ coverage.txt
target/
classes


# Gopkg.lock
# go mod, go test
vendor/
coverage.txt

logs/
.vscode/
coverage.txt

# unit test
remoting/zookeeper/zookeeper-4unittest/
config_center/zookeeper/zookeeper-4unittest/
registry/zookeeper/zookeeper-4unittest/
@@ -0,0 +1,26 @@
# Release Notes

## 1.1.0

### New Features

- Support Java bigdecimal<https://github.com/apache/dubbo-go/pull/126>;
- Support all JDK exceptions<https://github.com/apache/dubbo-go/pull/120>;
- Support multi-version of service<https://github.com/apache/dubbo-go/pull/119>;
- Allow user set custom params for registry<https://github.com/apache/dubbo-go/pull/117>;
- Support zookeeper config center<https://github.com/apache/dubbo-go/pull/99>;
- Failsafe/Failback Cluster Strategy<https://github.com/apache/dubbo-go/pull/136>;

### Enhancement

- Use time wheel instead of time.After to defeat timer object memory leakage<https://github.com/apache/dubbo-go/pull/130> ;

### Bugfixes

- Preventing dead loop when got zookeeper unregister event<https://github.com/apache/dubbo-go/pull/129>;
- Delete ineffassign<https://github.com/apache/dubbo-go/pull/127>;
- Add wg.Done() for mockDataListener<https://github.com/apache/dubbo-go/pull/118>;
- Delete wrong spelling words<https://github.com/apache/dubbo-go/pull/107>;
- Use sync.Map to defeat from gettyClientPool deadlock<https://github.com/apache/dubbo-go/pull/106>;
- Handle panic when function args list is empty<https://github.com/apache/dubbo-go/pull/98>;
- url.Values is not safe map<https://github.com/apache/dubbo-go/pull/172>;
@@ -176,7 +176,6 @@

END OF TERMS AND CONDITIONS


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -6,9 +6,6 @@
---
Apache Dubbo Go Implementation.

![Apache Dubbo-go](./dubbogo.png "Apache Dubbo-go")

Apache/Dubbo-go image, licensed under [Creative Commons 3.0 Attributions license](https://creativecommons.org/licenses/by/3.0/).

## License

@@ -34,19 +31,19 @@ Finished List:
- Transport: HTTP, TCP
- Codec: JsonRPC v2, Hessian v2
- Registry: ZooKeeper/[etcd v3](https://github.com/apache/dubbo-go/pull/148)/[nacos](https://github.com/apache/dubbo-go/pull/151)/[consul](https://github.com/apache/dubbo-go/pull/121)
- Configure Center: Zookeeper
- Dynamic Configure Center & Service Management Configurator: Zookeeper
- Cluster Strategy: Failover/[Failfast](https://github.com/apache/dubbo-go/pull/140)/[Failsafe/Failback](https://github.com/apache/dubbo-go/pull/136)/[Available](https://github.com/apache/dubbo-go/pull/155)/[Broadcast](https://github.com/apache/dubbo-go/pull/158)/[Forking](https://github.com/apache/dubbo-go/pull/161)
- Load Balance: Random/[RoundRobin](https://github.com/apache/dubbo-go/pull/66)/[LeastActive](https://github.com/apache/dubbo-go/pull/65)
- Filter: Echo Health Check/[Circuit break and service downgrade](https://github.com/apache/dubbo-go/pull/133)
- Filter: Echo Health Check/[Circuit break and service downgrade](https://github.com/apache/dubbo-go/pull/133)/[TokenFilter](https://github.com/apache/dubbo-go/pull/202)
- Other feature: [generic invoke](https://github.com/apache/dubbo-go/pull/122)/start check/connecting certain provider/multi-protocols/multi-registries/multi-versions/service group

Working List:

- Load Balance: ConsistentHash
- Filter: TokenFilter/AccessLogFilter/CountFilter/ExecuteLimitFilter/TpsLimitFilter
- Filter: AccessLogFilter/CountFilter/ExecuteLimitFilter/TpsLimitFilter
- Registry: k8s
- Configure Center: apollo
- Dynamic Configuration Center & Metadata Center (dubbo v2.7.x)
- Metadata Center (dubbo v2.7.x)
- Metrics: Promethus(dubbo v2.7.x)

Todo List:
@@ -67,6 +64,19 @@ The subdirectory examples shows how to use dubbo-go. Please read the [examples/R

## Running unit tests

### Prepare

Mac/Linux
```bash
sh ./before_ut.sh
```

Windows
```bash
before_ut.bat
```

# Run
```bash
go test ./...
@@ -5,9 +5,6 @@

---
Apache Dubbo Go 语言实现
![Apache Dubbo-go](./dubbogo.png "Apache Dubbo-go")

Apache/Dubbo-go image, licensed under [Creative Commons 3.0 Attributions license](https://creativecommons.org/licenses/by/3.0/).

## 证书 ##

@@ -33,20 +30,20 @@ Apache License, Version 2.0
- 传输协议: HTTP, TCP
- 序列化协议: JsonRPC v2, Hessian v2
- 注册中心: ZooKeeper/[etcd v3](https://github.com/apache/dubbo-go/pull/148)/[nacos](https://github.com/apache/dubbo-go/pull/151)/[consul](https://github.com/apache/dubbo-go/pull/121)
- 配置中心: Zookeeper
- 动态配置中心与服务治理配置器(config center): Zookeeper
- 集群策略: Failover/[Failfast](https://github.com/apache/dubbo-go/pull/140)/[Failsafe/Failback](https://github.com/apache/dubbo-go/pull/136)/[Available](https://github.com/apache/dubbo-go/pull/155)/[Broadcast](https://github.com/apache/dubbo-go/pull/158)/[Forking](https://github.com/apache/dubbo-go/pull/161)
- 负载均衡策略: Random/[RoundRobin](https://github.com/apache/dubbo-go/pull/66)/[LeastActive](https://github.com/apache/dubbo-go/pull/65)
- 过滤器: Echo Health Check/[服务熔断&降级](https://github.com/apache/dubbo-go/pull/133)
- 过滤器: Echo Health Check/[服务熔断&降级](https://github.com/apache/dubbo-go/pull/133)/[TokenFilter](https://github.com/apache/dubbo-go/pull/202)
- 其他功能支持: [泛化调用](https://github.com/apache/dubbo-go/pull/122)/启动时检查/服务直连/多服务协议/多注册中心/多服务版本/服务分组

开发中列表:

- 集群策略: Forking
- 负载均衡策略: ConsistentHash
- 过滤器: TokenFilter/AccessLogFilter/CountFilter/ExecuteLimitFilter/TpsLimitFilter
- 过滤器: AccessLogFilter/CountFilter/ExecuteLimitFilter/TpsLimitFilter
- 注册中心: k8s
- 配置中心: apollo
- 动态配置中心 & 元数据中心 (dubbo v2.7.x)
- 元数据中心 (dubbo v2.7.x)
- Metrics: Promethus(dubbo v2.7.x)

任务列表:
@@ -67,10 +64,23 @@ TODO

## 运行单测

### 准备

Mac/Linux
```bash
sh ./before_ut.sh
```

Windows
```bash
before_ut.bat
```

# 执行
```bash
go test ./...
# 覆盖率
# coverage
go test ./... -coverprofile=coverage.txt -covermode=atomic
```

@@ -0,0 +1,5 @@
set zkJar=zookeeper-3.4.9-fatjar.jar
md remoting\zookeeper\zookeeper-4unittest\contrib\fatjar config_center\zookeeper\zookeeper-4unittest\contrib\fatjar registry\zookeeper\zookeeper-4unittest\contrib\fatjar
curl -L https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/%zkJar% -o remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%
xcopy /f "remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%" "config_center/zookeeper/zookeeper-4unittest/contrib/fatjar/"
xcopy /f "remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/%zkJar%" "registry/zookeeper/zookeeper-4unittest/contrib/fatjar/"
@@ -0,0 +1,4 @@
mkdir -p remoting/zookeeper/zookeeper-4unittest/contrib/fatjar config_center/zookeeper/zookeeper-4unittest/contrib/fatjar registry/zookeeper/zookeeper-4unittest/contrib/fatjar
wget -P "remoting/zookeeper/zookeeper-4unittest/contrib/fatjar" https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar
cp remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar config_center/zookeeper/zookeeper-4unittest/contrib/fatjar/
cp remoting/zookeeper/zookeeper-4unittest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar registry/zookeeper/zookeeper-4unittest/contrib/fatjar/
@@ -18,6 +18,7 @@
package cluster_impl

import (
"strconv"
"sync"
"time"
)
@@ -54,15 +55,18 @@ func newFailbackClusterInvoker(directory cluster.Directory) protocol.Invoker {
invoker := &failbackClusterInvoker{
baseClusterInvoker: newBaseClusterInvoker(directory),
}
retriesConfig := invoker.GetUrl().GetParamInt(constant.RETRIES_KEY, constant.DEFAULT_FAILBACK_TIMES)
if retriesConfig <= 0 {
retriesConfig = constant.DEFAULT_FAILBACK_TIMES
retriesConfig := invoker.GetUrl().GetParam(constant.RETRIES_KEY, constant.DEFAULT_FAILBACK_TIMES)
retries, err := strconv.Atoi(retriesConfig)
if err != nil || retries < 0 {
logger.Error("Your retries config is invalid,pls do a check. And will use the default fail back times configuration instead.")
retries = constant.DEFAULT_FAILBACK_TIMES_INT
}

failbackTasksConfig := invoker.GetUrl().GetParamInt(constant.FAIL_BACK_TASKS_KEY, constant.DEFAULT_FAILBACK_TASKS)
if failbackTasksConfig <= 0 {
failbackTasksConfig = constant.DEFAULT_FAILBACK_TASKS
}
invoker.maxRetries = retriesConfig
invoker.maxRetries = int64(retries)
invoker.failbackTasks = failbackTasksConfig
return invoker
}
@@ -17,13 +17,18 @@

package cluster_impl

import (
"strconv"
)

import (
perrors "github.com/pkg/errors"
)

import (
"github.com/apache/dubbo-go/cluster"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/protocol"
)
@@ -53,16 +58,21 @@ func (invoker *failoverClusterInvoker) Invoke(invocation protocol.Invocation) pr
url := invokers[0].GetUrl()

//get reties
retries := url.GetParamInt(constant.RETRIES_KEY, constant.DEFAULT_RETRIES)
retriesConfig := url.GetParam(constant.RETRIES_KEY, constant.DEFAULT_RETRIES)

//Get the service method loadbalance config if have
if v := url.GetMethodParamInt(methodName, constant.RETRIES_KEY, 0); v != 0 {
retries = v
if v := url.GetMethodParam(methodName, constant.RETRIES_KEY, ""); len(v) != 0 {
retriesConfig = v
}
retries, err := strconv.Atoi(retriesConfig)
if err != nil || retries < 0 {
logger.Error("Your retries config is invalid,pls do a check. And will use the default retries configuration instead.")
retries = constant.DEFAULT_RETRIES_INT
}
invoked := []protocol.Invoker{}
providers := []string{}
var result protocol.Result
for i := int64(0); i < retries; i++ {
for i := 0; i <= retries; i++ {
//Reselect before retry to avoid a change of candidate `invokers`.
//NOTE: if `invokers` changed, then `invoked` also lose accuracy.
if i > 0 {
@@ -118,22 +118,22 @@ func normalInvoke(t *testing.T, successCount int, urlParam url.Values, invocatio
}
func Test_FailoverInvokeSuccess(t *testing.T) {
urlParams := url.Values{}
result := normalInvoke(t, 2, urlParams)
result := normalInvoke(t, 3, urlParams)
assert.NoError(t, result.Error())
count = 0
}

func Test_FailoverInvokeFail(t *testing.T) {
urlParams := url.Values{}
result := normalInvoke(t, 3, urlParams)
result := normalInvoke(t, 4, urlParams)
assert.Errorf(t, result.Error(), "error")
count = 0
}

func Test_FailoverInvoke1(t *testing.T) {
urlParams := url.Values{}
urlParams.Set(constant.RETRIES_KEY, "3")
result := normalInvoke(t, 3, urlParams)
result := normalInvoke(t, 4, urlParams)
assert.NoError(t, result.Error())
count = 0
}
@@ -144,7 +144,7 @@ func Test_FailoverInvoke2(t *testing.T) {
urlParams.Set("methods.test."+constant.RETRIES_KEY, "3")

ivc := invocation.NewRPCInvocationWithOptions(invocation.WithMethodName("test"))
result := normalInvoke(t, 3, urlParams, ivc)
result := normalInvoke(t, 4, urlParams, ivc)
assert.NoError(t, result.Error())
count = 0
}
@@ -42,6 +42,9 @@ func NewBaseDirectory(url *common.URL) BaseDirectory {
func (dir *BaseDirectory) GetUrl() common.URL {
return *dir.url
}
func (dir *BaseDirectory) GetDirectoryUrl() *common.URL {
return dir.url
}

func (dir *BaseDirectory) Destroy(doDestroy func()) {
if dir.destroyed.CAS(false, true) {
@@ -15,7 +15,6 @@
* limitations under the License.
*/

// @author yiji@apache.org
package loadbalance

import (
@@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package loadbalance

import (

0 comments on commit ad63215

Please sign in to comment.
You can’t perform that action at this time.