Compare commits
181 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
58d1259cb9 | |
|
|
0aee810166 | |
|
|
3b2b20b34c | |
|
|
40f44fe0e6 | |
|
|
42c3a07db3 | |
|
|
41b0a22ea4 | |
|
|
6ea05b5a20 | |
|
|
e9d35554c7 | |
|
|
59da412eae | |
|
|
2e39f6d31b | |
|
|
f62ca3f71a | |
|
|
86b5e00ba2 | |
|
|
5e68e43912 | |
|
|
3f1e3f491d | |
|
|
fc1bdfa945 | |
|
|
c5ed7def80 | |
|
|
115cc7ff9d | |
|
|
077da34add | |
|
|
3a9172fcfa | |
|
|
9783ef060a | |
|
|
1d60fdf85a | |
|
|
6cea97fcad | |
|
|
37c3460bf7 | |
|
|
346c668386 | |
|
|
b100a6d22b | |
|
|
7165e382d8 | |
|
|
89e5fe0f27 | |
|
|
951d30644a | |
|
|
c66d95ab3e | |
|
|
b442d2bc8d | |
|
|
87a634db05 | |
|
|
34d1a3724d | |
|
|
64d8e36ff3 | |
|
|
e10b8dd6a9 | |
|
|
c894e06335 | |
|
|
d895bf15d0 | |
|
|
5e2c07c1dc | |
|
|
4a8abfd0ba | |
|
|
a9f0762f5e | |
|
|
59320a9eeb | |
|
|
280d54c07d | |
|
|
e778d5ad3a | |
|
|
585bb1193f | |
|
|
bada690763 | |
|
|
5a6a069986 | |
|
|
8c2141cd1c | |
|
|
98cfbd6535 | |
|
|
112990d063 | |
|
|
a8f6f99e43 | |
|
|
69cc9bded6 | |
|
|
07bcafb3ae | |
|
|
89b213f78d | |
|
|
77970748f2 | |
|
|
116c9c33eb | |
|
|
5d6baa5489 | |
|
|
36fc6c566f | |
|
|
5bdbc886cb | |
|
|
5c5ac0ab90 | |
|
|
8969b34b09 | |
|
|
281ab19ed4 | |
|
|
6f593a6fd2 | |
|
|
c8facc5ef6 | |
|
|
6702cbdb0e | |
|
|
0e886a966c | |
|
|
f932569938 | |
|
|
87a2f07542 | |
|
|
ef176f96f3 | |
|
|
ffce958ee0 | |
|
|
68042366c2 | |
|
|
10309b36d3 | |
|
|
4785a27fb4 | |
|
|
5672e52b12 | |
|
|
8683da7231 | |
|
|
00a8edcc26 | |
|
|
ef2cae1fc0 | |
|
|
d430ca9b17 | |
|
|
ba7f6f38c3 | |
|
|
2970f87373 | |
|
|
34b9ebfb2d | |
|
|
c528d56b6e | |
|
|
fec3363b74 | |
|
|
4a28ea1379 | |
|
|
badea862d3 | |
|
|
40b0ff28f3 | |
|
|
0f9cef935d | |
|
|
54e14e905c | |
|
|
342e814296 | |
|
|
19f30941f2 | |
|
|
43d8620cee | |
|
|
7fbfc37e58 | |
|
|
3375ec8278 | |
|
|
ac49a7d34a | |
|
|
483cd7c45f | |
|
|
0e50d65511 | |
|
|
1be26c9965 | |
|
|
38e0f15be3 | |
|
|
7b1985a1a6 | |
|
|
c290991cb5 | |
|
|
faa0abf7c2 | |
|
|
9cc4f933a2 | |
|
|
7629e73090 | |
|
|
86c473771a | |
|
|
a1b27ab18c | |
|
|
d6aae075b1 | |
|
|
ef4ecdf3a3 | |
|
|
5da01b1d27 | |
|
|
f2d73f7914 | |
|
|
0b0e8b5c0a | |
|
|
bcb1899f31 | |
|
|
4cd9619130 | |
|
|
2af5a6ddbb | |
|
|
c84d79f99f | |
|
|
c5a5b64a10 | |
|
|
bb9fd69233 | |
|
|
e0bf21aed5 | |
|
|
e4725cd687 | |
|
|
f58997f4aa | |
|
|
a531a5cb9a | |
|
|
dca95745c4 | |
|
|
2e826a65c7 | |
|
|
0b94b35992 | |
|
|
311d2b06bc | |
|
|
156ac39bb3 | |
|
|
5adb9bfb59 | |
|
|
c4eb4e8ceb | |
|
|
79ea2acba8 | |
|
|
f77c9fcc5e | |
|
|
28e10374a9 | |
|
|
0ac21f0697 | |
|
|
d7af5d917c | |
|
|
88037747a3 | |
|
|
f7baac7cd0 | |
|
|
3750059072 | |
|
|
57399a2cf0 | |
|
|
39ea8a8aa8 | |
|
|
5968f1a3f8 | |
|
|
2881738b7d | |
|
|
a0c1bef09f | |
|
|
d57a58c9a1 | |
|
|
acd7000224 | |
|
|
97d20a3622 | |
|
|
7ece161538 | |
|
|
52e9290d12 | |
|
|
8ae95c9542 | |
|
|
c7e7c14346 | |
|
|
ba51bab395 | |
|
|
6ce7b11f98 | |
|
|
b6b5415068 | |
|
|
d60e8240c3 | |
|
|
3963d8fd93 | |
|
|
375e2b9db6 | |
|
|
84f3215a4f | |
|
|
f33e5b37d4 | |
|
|
84b0afb300 | |
|
|
97124e91f4 | |
|
|
93d2eb674b | |
|
|
bfb95aff7e | |
|
|
bbfcb4124f | |
|
|
1ea098e1e1 | |
|
|
7884aec202 | |
|
|
22899a4b39 | |
|
|
44b9139b16 | |
|
|
69311abe3a | |
|
|
73d86a9d6e | |
|
|
79859aa20c | |
|
|
0278a0145f | |
|
|
5d8048bb1f | |
|
|
6429ac4e57 | |
|
|
e4aea68c97 | |
|
|
0882c83bb9 | |
|
|
d90540beea | |
|
|
a8be0eaadd | |
|
|
77757c3d23 | |
|
|
89017cedbc | |
|
|
ee21cea888 | |
|
|
47a4876a77 | |
|
|
0f36a0517d | |
|
|
cb6f7729fd | |
|
|
5e82a5eef6 | |
|
|
d1ca37db71 | |
|
|
00bad2e89b |
117
.artifacts
117
.artifacts
|
|
@ -1,117 +0,0 @@
|
|||
# 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.
|
||||
#
|
||||
|
||||
# Please add new modules to the end of the list.
|
||||
|
||||
dubbo
|
||||
dubbo-auth
|
||||
dubbo-apache-release
|
||||
dubbo-bom
|
||||
dubbo-build-tools
|
||||
dubbo-cluster
|
||||
dubbo-common
|
||||
dubbo-compatible
|
||||
dubbo-compiler
|
||||
dubbo-config
|
||||
dubbo-config-api
|
||||
dubbo-config-spring
|
||||
dubbo-configcenter
|
||||
dubbo-configcenter-apollo
|
||||
dubbo-configcenter-nacos
|
||||
dubbo-configcenter-zookeeper
|
||||
dubbo-container
|
||||
dubbo-container-api
|
||||
dubbo-container-spring
|
||||
dubbo-core-spi
|
||||
dubbo-dependencies
|
||||
dubbo-dependencies-all
|
||||
dubbo-dependencies-bom
|
||||
dubbo-dependencies-zookeeper
|
||||
dubbo-dependencies-zookeeper-curator5
|
||||
dubbo-distribution
|
||||
dubbo-filter
|
||||
dubbo-filter-cache
|
||||
dubbo-filter-validation
|
||||
dubbo-kubernetes
|
||||
dubbo-maven-plugin
|
||||
dubbo-metadata
|
||||
dubbo-metadata-api
|
||||
dubbo-metadata-definition-protobuf
|
||||
dubbo-metadata-processor
|
||||
dubbo-metadata-report-nacos
|
||||
dubbo-metadata-report-redis
|
||||
dubbo-metadata-report-zookeeper
|
||||
dubbo-metrics
|
||||
dubbo-metrics-api
|
||||
dubbo-metrics-default
|
||||
dubbo-metrics-metadata
|
||||
dubbo-metrics-prometheus
|
||||
dubbo-metrics-registry
|
||||
dubbo-metrics-config-center
|
||||
dubbo-monitor
|
||||
dubbo-monitor-api
|
||||
dubbo-monitor-default
|
||||
dubbo-native
|
||||
dubbo-native-plugin
|
||||
dubbo-parent
|
||||
dubbo-plugin
|
||||
dubbo-qos
|
||||
dubbo-qos-api
|
||||
dubbo-reactive
|
||||
dubbo-registry
|
||||
dubbo-registry-api
|
||||
dubbo-registry-multicast
|
||||
dubbo-registry-multiple
|
||||
dubbo-registry-nacos
|
||||
dubbo-registry-zookeeper
|
||||
dubbo-remoting
|
||||
dubbo-remoting-api
|
||||
dubbo-remoting-http
|
||||
dubbo-remoting-netty
|
||||
dubbo-remoting-netty4
|
||||
dubbo-remoting-zookeeper
|
||||
dubbo-remoting-zookeeper-curator5
|
||||
dubbo-rpc
|
||||
dubbo-rpc-api
|
||||
dubbo-rpc-dubbo
|
||||
dubbo-rpc-injvm
|
||||
dubbo-rpc-rest
|
||||
dubbo-rpc-triple
|
||||
dubbo-security
|
||||
dubbo-serialization
|
||||
dubbo-serialization-api
|
||||
dubbo-serialization-fastjson2
|
||||
dubbo-serialization-hessian2
|
||||
dubbo-serialization-jdk
|
||||
dubbo-spring-boot
|
||||
dubbo-spring-boot-actuator
|
||||
dubbo-spring-boot-actuator-compatible
|
||||
dubbo-spring-boot-autoconfigure
|
||||
dubbo-spring-boot-autoconfigure-compatible
|
||||
dubbo-spring-boot-compatible
|
||||
dubbo-spring-boot-observability-starters
|
||||
dubbo-spring-boot-observability-autoconfigure
|
||||
dubbo-spring-boot-tracing-brave-zipkin-starter
|
||||
dubbo-spring-boot-tracing-otel-zipkin-starter
|
||||
dubbo-spring-boot-tracing-otel-otlp-starter
|
||||
dubbo-spring-boot-observability-starter
|
||||
dubbo-spring-boot-starter
|
||||
dubbo-spring-boot-starters
|
||||
dubbo-nacos-spring-boot-starter
|
||||
dubbo-zookeeper-spring-boot-starter
|
||||
dubbo-zookeeper-curator5-spring-boot-starter
|
||||
dubbo-spring-security
|
||||
dubbo-xds
|
||||
59
.asf.yaml
59
.asf.yaml
|
|
@ -1,59 +0,0 @@
|
|||
#
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
notifications:
|
||||
commits: commits@dubbo.apache.org
|
||||
issues: notifications@dubbo.apache.org
|
||||
pullrequests: notifications@dubbo.apache.org
|
||||
jira_options: link label link label
|
||||
|
||||
github:
|
||||
homepage: https://dubbo.apache.org/
|
||||
description: "The java implementation of Apache Dubbo. An RPC and microservice framework."
|
||||
features:
|
||||
# Enable wiki for documentation
|
||||
wiki: true
|
||||
# Enable issue management
|
||||
issues: true
|
||||
# Enable projects for project management boards
|
||||
projects: true
|
||||
protected_branches:
|
||||
master:
|
||||
# only disable force push
|
||||
foo: bar
|
||||
3.0:
|
||||
# only disable force push
|
||||
foo: bar
|
||||
3.1:
|
||||
# only disable force push
|
||||
foo: bar
|
||||
labels:
|
||||
- java
|
||||
- rpc
|
||||
- microservices
|
||||
- framework
|
||||
- restful
|
||||
- distributed-systems
|
||||
- dubbo
|
||||
- service-mesh
|
||||
- http
|
||||
- grpc
|
||||
- web
|
||||
collaborators:
|
||||
- oxsean
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
coverage:
|
||||
status:
|
||||
# pull-requests only
|
||||
patch:
|
||||
default:
|
||||
threshold: 0.1%
|
||||
ignore:
|
||||
- "dubbo-demo/.*"
|
||||
- "dubbo-common/src/main/java/com/alibaba/dubbo/common/json/*.java" # internal JSON impl is deprecate, ignore test coverage for them
|
||||
- "dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/AnnotationBean.java" # Deprecated
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
# 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.
|
||||
#
|
||||
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
tab_width = 4
|
||||
max_line_length = 120
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.java]
|
||||
ij_java_continuation_indent_size = 8
|
||||
ij_java_keep_control_statement_in_one_line = false
|
||||
ij_java_for_brace_force = always
|
||||
ij_java_if_brace_force = always
|
||||
ij_java_keep_first_column_comment = false
|
||||
ij_java_keep_line_breaks = false
|
||||
ij_java_keep_simple_blocks_in_one_line = true
|
||||
ij_java_keep_simple_classes_in_one_line = true
|
||||
ij_java_keep_simple_lambdas_in_one_line = true
|
||||
ij_java_keep_simple_methods_in_one_line = true
|
||||
ij_java_keep_blank_lines_in_code = 1
|
||||
ij_java_keep_blank_lines_in_declarations = 1
|
||||
ij_java_class_count_to_use_import_on_demand = 999
|
||||
ij_java_names_count_to_use_import_on_demand = 999
|
||||
ij_java_imports_layout = org.apache.dubbo.**, |, javax.**, |, java.**, |, *, |, $*
|
||||
ij_java_insert_inner_class_imports = true
|
||||
ij_java_space_before_array_initializer_left_brace = true
|
||||
ij_java_method_parameters_new_line_after_left_paren = true
|
||||
ij_java_wrap_comments = true
|
||||
ij_java_wrap_long_lines = true
|
||||
ij_java_enum_constants_wrap = split_into_lines
|
||||
ij_java_method_call_chain_wrap = split_into_lines
|
||||
ij_java_method_parameters_wrap = on_every_item
|
||||
ij_java_extends_list_wrap = on_every_item
|
||||
ij_java_extends_keyword_wrap = normal
|
||||
ij_java_binary_operation_wrap = normal
|
||||
ij_java_binary_operation_sign_on_next_line = true
|
||||
|
||||
[*.json]
|
||||
tab_width = 2
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.xml]
|
||||
ij_xml_attribute_wrap = off
|
||||
ij_xml_text_wrap = off
|
||||
ij_xml_keep_blank_lines = 1
|
||||
|
||||
[pom.xml]
|
||||
indent_size = 2
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
# 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.
|
||||
#
|
||||
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
*.java text eol=lf
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
title: "[General][Java SDK (Component)] xxx"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to share your idea! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English idea is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
- "Go SDK (apache/dubbo-go)"
|
||||
- "Go Samples (apache/dubbo-go-samples)"
|
||||
- "Rust SDK (apache/dubbo-rust)"
|
||||
- "Node.js SDK (apache/dubbo-js)"
|
||||
- "Python SDK (apache/dubbo-python)"
|
||||
- "Kubernetes Integration (apache/dubbo-kubernetes)"
|
||||
- "Pixiu Gateway (apache/dubbo-go-pixiu)"
|
||||
- "Pixiu Gateway Samples (apache/dubbo-go-pixiu-samples)"
|
||||
- "Admin (apache/dubbo-admin)"
|
||||
- "Website (apache/dubbo-website)"
|
||||
- "Awesome (apache/dubbo-awesome)"
|
||||
- "Initializer (apache/dubbo-intializer)"
|
||||
- "Others (apache/dubbo-xxx)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Details
|
||||
description: Anything you want to ask?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
title: "[Q/A][Java SDK (Component)] xxx"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to report the question! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English question is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
- "Go SDK (apache/dubbo-go)"
|
||||
- "Go Samples (apache/dubbo-go-samples)"
|
||||
- "Rust SDK (apache/dubbo-rust)"
|
||||
- "Node.js SDK (apache/dubbo-js)"
|
||||
- "Python SDK (apache/dubbo-python)"
|
||||
- "Kubernetes Integration (apache/dubbo-kubernetes)"
|
||||
- "Pixiu Gateway (apache/dubbo-go-pixiu)"
|
||||
- "Pixiu Gateway Samples (apache/dubbo-go-pixiu-samples)"
|
||||
- "Admin (apache/dubbo-admin)"
|
||||
- "Website (apache/dubbo-website)"
|
||||
- "Awesome (apache/dubbo-awesome)"
|
||||
- "Initializer (apache/dubbo-intializer)"
|
||||
- "Others (apache/dubbo-xxx)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Details
|
||||
description: Anything you want to know?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
title: "[Bug] "
|
||||
labels: ["type/need-triage", "component/need-triage"]
|
||||
projects: ["apache/337"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to report the problem! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
Please make sure what you are reporting is indeed a bug with reproducible steps, if you want to ask questions
|
||||
or share ideas, please [subscribe to our mailing list](mailto:dev-subscribe@dubbo.apache.org) and sent
|
||||
emails to [our mailing list](mailto:dev@dubbo.apache.org), you can also head to our
|
||||
[Discussion](https://github.com/apache/dubbo/discussions) tab.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English issues is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please make sure to search in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) first to see
|
||||
whether the same issue was reported already.
|
||||
options:
|
||||
- label: >
|
||||
I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar
|
||||
issues.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Dubbo Version
|
||||
description: "Which Dubbo version, JDK version and operating system did you use?"
|
||||
placeholder: "Example: Dubbo Java 3.2.12, OpenJDK 1.8, Ubuntu 20.04"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce this issue
|
||||
description: >
|
||||
Describe how to reproduce this issue.If you are not able to provide a reproducible case,
|
||||
please open a [Discussion](https://github.com/apache/dubbo/discussions) instead.
|
||||
placeholder: >
|
||||
Please provide the context in which the problem occurred and explain what happened.
|
||||
A [GitHub address] would be helpful for maintainers to reproduce the problem.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What you expected to happen
|
||||
description: What do you think went wrong?
|
||||
placeholder: >
|
||||
Please explain why you think the behaviour is erroneous. It is extremely helpful if you copy and paste
|
||||
the fragment of logs showing the exact error messages or wrong behaviour and screenshots for
|
||||
UI problems. You can include files by dragging and dropping them here.
|
||||
|
||||
**NOTE**: please copy and paste texts instead of taking screenshots of them for easy future search.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else
|
||||
description: Anything else we need to know?
|
||||
placeholder: >
|
||||
How often does this problem occur? (Once? Every time? Only when certain conditions are met?)
|
||||
Any relevant logs to include? Put them here inside fenced
|
||||
``` ``` blocks or inside a collapsable details tag if it's too long:
|
||||
<details><summary>x.log</summary> lots of stuff </details>
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a pull request to fix on your own?
|
||||
description: >
|
||||
This is absolutely not required, but we are happy to guide you in the contribution process
|
||||
especially if you already have a good understanding of how to implement the fix.
|
||||
Dubbo is a totally community-driven project and we love to bring new contributors in.
|
||||
options:
|
||||
- label: Yes I am willing to submit a pull request on my own!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
name: Feature Request
|
||||
description: Create a Feature Request for Dubbo
|
||||
title: "[Feature] "
|
||||
labels: ["type/need-triage", "component/need-triage"]
|
||||
projects: ["apache/337"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to propose new feature!
|
||||
|
||||
We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English issues is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please make sure to search in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) first to see
|
||||
whether the same feature was requested already.
|
||||
options:
|
||||
- label: >
|
||||
I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar
|
||||
feature requirement.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Descriptions
|
||||
description: A short description of your feature
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Related issues
|
||||
description: Is there currently another issue associated with this?
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a pull request to fix on your own?
|
||||
description: >
|
||||
This is absolutely not required, but we are happy to guide you in the contribution process
|
||||
especially if you already have a good understanding of how to implement the feature.
|
||||
Dubbo is a totally community-driven project and we love to bring new contributors in.
|
||||
options:
|
||||
- label: Yes I am willing to submit a pull request on my own!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question & FAQ & Proposal
|
||||
url: https://github.com/apache/dubbo/discussions/
|
||||
about: Ask a question, request support or submit a proposal for Apache Dubbo.
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
## What is the purpose of the change
|
||||
|
||||
|
||||
|
||||
## Brief changelog
|
||||
|
||||
|
||||
## Verifying this change
|
||||
|
||||
|
||||
<!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
|
||||
|
||||
## Checklist
|
||||
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) 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.
|
||||
- [ ] 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.
|
||||
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
|
||||
- [ ] 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](https://github.com/apache/dubbo-samples) project.
|
||||
- [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
|
||||
- [ ] GitHub Actions works fine on your own branch.
|
||||
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
version: 2
|
||||
updates:
|
||||
|
||||
- package-ecosystem: "maven"
|
||||
directory: "/"
|
||||
open-pull-requests-limit: 20
|
||||
# Ignore major version updates
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "03:00"
|
||||
timezone: "US/Eastern"
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
name: Build and Test For Dubbo 2.6
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
unit-test:
|
||||
name: "Unit Test On JDK: ${{ matrix.jdk }}"
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v2
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Test with Maven"
|
||||
timeout-minutes: 30
|
||||
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean test install -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -Dcheckstyle.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v1
|
||||
|
|
@ -1,604 +0,0 @@
|
|||
name: Build and Test For PR
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORK_COUNT: 2
|
||||
FAIL_FAST: 0
|
||||
SHOW_ERROR_DETAIL: 1
|
||||
#multi-version size limit
|
||||
VERSIONS_LIMIT: 4
|
||||
JACOCO_ENABLE: true
|
||||
CANDIDATE_VERSIONS: '
|
||||
spring.version:5.3.24;
|
||||
spring-boot.version:2.7.6;
|
||||
'
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
name: Check if code needs formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Maven
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 21
|
||||
distribution: zulu
|
||||
- name: Check if code aligns with code style
|
||||
id: check
|
||||
run: mvn --log-file mvn.log spotless:check
|
||||
continue-on-error: true
|
||||
- name: Upload checkstyle result
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkstyle-result
|
||||
path: mvn.log
|
||||
- name: Generate Summary for successful run
|
||||
if: ${{ steps.check.outcome == 'success' }}
|
||||
run: |
|
||||
echo ":ballot_box_with_check: Kudos! No formatting issues found!" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Generate Summary for failed run
|
||||
if: ${{ steps.check.outcome == 'failure' }}
|
||||
run: |
|
||||
echo "## :negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
cat mvn.log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' | head -n -11 >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Please run \`mvn spotless:apply\` to fix the formatting issues." >> $GITHUB_STEP_SUMMARY
|
||||
- name: Fail if code needs formatting
|
||||
if: ${{ steps.check.outcome == 'failure' }}
|
||||
uses: actions/github-script@v7.0.1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
core.setFailed("Formatting issues found!")
|
||||
|
||||
license:
|
||||
name: "Check License"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@e1a02359b239bd28de3f6d35fdc870250fa513d5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: Check Dependencies' License
|
||||
uses: apache/skywalking-eyes/dependency@e1a02359b239bd28de3f6d35fdc870250fa513d5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
config: .licenserc.yaml
|
||||
mode: check
|
||||
|
||||
build-source:
|
||||
name: "Build Dubbo"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: dubbo
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
- name: "Build Dubbo with Maven"
|
||||
run: |
|
||||
cd ./dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Pack class result"
|
||||
run: |
|
||||
shopt -s globstar
|
||||
zip ${{ github.workspace }}/class.zip **/target/classes/* -r
|
||||
- name: "Upload class result"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "class-file"
|
||||
path: ${{ github.workspace }}/class.zip
|
||||
- name: "Pack checkstyle file if failure"
|
||||
if: failure()
|
||||
run: zip ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
|
||||
- name: "Upload checkstyle file if failure"
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "checkstyle-file"
|
||||
path: ${{ github.workspace }}/checkstyle.zip
|
||||
- name: "Calculate Dubbo Version"
|
||||
id: dubbo-version
|
||||
run: |
|
||||
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
|
||||
echo "version=$REVISION" >> $GITHUB_OUTPUT
|
||||
echo "dubbo version: $REVISION"
|
||||
|
||||
unit-test-prepare:
|
||||
name: "Preparation for Unit Test"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
env:
|
||||
ZOOKEEPER_VERSION: 3.6.3
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
- name: "Set up msys2 if necessary"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
release: false # support cache, see https://github.com/msys2/setup-msys2#context
|
||||
- name: "Download zookeeper binary archive in Linux OS"
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache secret key"
|
||||
id: "cache-secret-cert"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/rsa
|
||||
key: secret-rsa-${{ runner.os }}-${{ github.run_id }}
|
||||
- name: "Create Secret"
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/rsa
|
||||
cd ${{ github.workspace }}/.tmp/rsa
|
||||
openssl genrsa -out rsa_private.pem 1024
|
||||
openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem
|
||||
echo "Current workflow run id: ${{ github.run_id }}"
|
||||
echo "Start Print Rsa Public Key ---"
|
||||
cat rsa_public.pem
|
||||
echo "--- End Print Rsa Public Key"
|
||||
|
||||
unit-test:
|
||||
needs: [check-format, build-source, unit-test-prepare]
|
||||
name: "Unit Test On ubuntu-latest"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
CURRENT_ROLE: ${{ matrix.case-role }}
|
||||
DUBBO_DEFAULT_SERIALIZATION: fastjson2
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache secret key"
|
||||
id: "cache-secret-cert"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/rsa
|
||||
key: secret-rsa-${{ runner.os }}-${{ github.run_id }}
|
||||
- name: "Get sonarcloud token"
|
||||
if: ${{ github.repository == 'apache/dubbo' }}
|
||||
run: |
|
||||
curl "http://dubbo-vm.apache.org:8000/token?workflow_id=${{ github.run_id }}" -o ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token
|
||||
openssl rsautl -decrypt -in ${{ github.workspace }}/.tmp/encrypted-sonarcloud-token -out ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token -inkey ${{ github.workspace }}/.tmp/rsa/rsa_private.pem
|
||||
- name: "Test with Maven with SonarCloud Scan"
|
||||
if: ${{ github.repository == 'apache/dubbo' }}
|
||||
timeout-minutes: 70
|
||||
env:
|
||||
# Needed to get some information about the pull request, if any
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
source ${{ github.workspace }}/.tmp/decrypted-sonarcloud-token
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -DtrimStackTrace=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.login=${SONAR_TOKEN}
|
||||
- name: "Test with Maven without SonarCloud Scan"
|
||||
if: ${{ github.repository != 'apache/dubbo' }}
|
||||
timeout-minutes: 70
|
||||
run: |
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Pjacoco,jdk15ge-simple,'!jdk15ge',jacoco089 -DtrimStackTrace=false -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Upload coverage result"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-result
|
||||
path: "**/target/site/**/jacoco.xml"
|
||||
|
||||
samples-test-prepare:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 3
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [check-format, build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: 8
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job_id: [1, 2, 3]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK 8"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "merge jacoco resule"
|
||||
run: |
|
||||
cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}"
|
||||
- name: "Upload jacoco"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-jacoco-result
|
||||
path: target/jacoco*.exec
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-result
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [check-format, samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: 8
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-result
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 3
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [check-format, build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: 8
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job_id: [1, 2, 3]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK 8"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "merge jacoco resule"
|
||||
run: |
|
||||
cd test/dubbo-test-jacoco-merger && mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoMerge" -Dexec.args="${{github.workspace}}"
|
||||
- name: "Upload jacoco"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jacoco-result
|
||||
path: target/jacoco*.exec
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-result
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [check-format, integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: 8
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: test-result
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
jacoco-result-merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-format, integration-test-result, samples-test-result, unit-test]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
path: "./dubbo-samples"
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
path: "./dubbo-integration-cases"
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
- name: "Restore class result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: "class-file"
|
||||
path: ${{ github.workspace }}
|
||||
- name: "Unpack class result"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
unzip -o ${{ github.workspace }}/class.zip
|
||||
- name: "Restore jacoco exec"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-jacoco-result
|
||||
path: dubbo-samples/target/
|
||||
- name: "Restore integration jacoco exec"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jacoco-result
|
||||
path: dubbo-integration-cases/target/
|
||||
- name: "Merge jacoco result"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger
|
||||
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo"
|
||||
- name: "Merge samples jacoco result"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-integration-cases/test/dubbo-test-jacoco-merger
|
||||
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-integration-cases ${{github.workspace}}/dubbo"
|
||||
- name: "Restore coverage result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: coverage-result
|
||||
path: dubbo/
|
||||
- name: "Upload coverage to Codecov"
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
verbose: true
|
||||
|
||||
error-code-inspecting:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-test-tools'
|
||||
ref: main
|
||||
path: "./dubbo-test-tools"
|
||||
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: "Run Error Code Inspecting"
|
||||
env:
|
||||
DUBBO_ECI_REPORT_AS_ERROR: true
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
|
||||
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
|
||||
|
||||
- name: "Upload error code inspection result"
|
||||
# always() should not be used here, since we don't need to handle the 'canceled' situation.
|
||||
if: ${{ success() || failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
nohup ./target/dubbo-demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
./target/dubbo-demo-native-consumer
|
||||
|
|
@ -1,502 +0,0 @@
|
|||
name: Build and Test Scheduled On 3.1
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0/6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORK_COUNT: 2
|
||||
FAIL_FAST: 0
|
||||
SHOW_ERROR_DETAIL: 1
|
||||
#multi-version size limit
|
||||
VERSIONS_LIMIT: 4
|
||||
ALL_REMOTE_VERSION: true
|
||||
CANDIDATE_VERSIONS: '
|
||||
spring.version:5.3.24;
|
||||
spring-boot.version:2.7.6;
|
||||
'
|
||||
|
||||
jobs:
|
||||
license:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
build-source:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
path: dubbo
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
- name: "Build Dubbo with Maven"
|
||||
run: |
|
||||
cd ./dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Pack checkstyle file if failure"
|
||||
if: failure()
|
||||
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
|
||||
- name: "Upload checkstyle file if failure"
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "checkstyle-file"
|
||||
path: ${{ github.workspace }}/checkstyle.zip
|
||||
- name: "Calculate Dubbo Version"
|
||||
id: dubbo-version
|
||||
run: |
|
||||
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
|
||||
echo "version=$REVISION" >> $GITHUB_OUTPUT
|
||||
echo "dubbo version: $REVISION"
|
||||
|
||||
unit-test-prepare:
|
||||
name: " Preparation for Unit Test On ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
env:
|
||||
ZOOKEEPER_VERSION: 3.6.3
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
- name: "Set up msys2 if necessary"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
release: false # support cache, see https://github.com/msys2/setup-msys2#context
|
||||
- name: "Download zookeeper binary archive in Linux OS"
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
- name: "Download zookeeper binary archive in Windows OS"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
|
||||
unit-test:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
unit-test-fastjson2:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }}, Serialization: fastjson2)"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
DUBBO_DEFAULT_SERIALIZATION: fastjson2
|
||||
MAVEN_SUREFIRE_ADD_OPENS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests on JDK 8"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests on JDK 8"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
samples-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
error-code-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
path: "./dubbo"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-test-tools'
|
||||
ref: main
|
||||
path: "./dubbo-test-tools"
|
||||
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: "Run Error Code Inspecting"
|
||||
env:
|
||||
DUBBO_ECI_REPORT_AS_ERROR: true
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
|
||||
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
|
||||
|
||||
- name: "Upload error code inspection result"
|
||||
# always() should not be used here, since we don't need to handle the 'canceled' situation.
|
||||
if: ${{ success() || failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.1"
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
nohup ./target/dubbo-demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
./target/dubbo-demo-native-consumer
|
||||
|
|
@ -1,502 +0,0 @@
|
|||
name: Build and Test Scheduled On 3.2
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0/6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORK_COUNT: 2
|
||||
FAIL_FAST: 0
|
||||
SHOW_ERROR_DETAIL: 1
|
||||
#multi-version size limit
|
||||
VERSIONS_LIMIT: 4
|
||||
ALL_REMOTE_VERSION: true
|
||||
CANDIDATE_VERSIONS: '
|
||||
spring.version:5.3.24;
|
||||
spring-boot.version:2.7.6;
|
||||
'
|
||||
|
||||
jobs:
|
||||
license:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
build-source:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
path: dubbo
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
- name: "Build Dubbo with Maven"
|
||||
run: |
|
||||
cd ./dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Pack checkstyle file if failure"
|
||||
if: failure()
|
||||
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
|
||||
- name: "Upload checkstyle file if failure"
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "checkstyle-file"
|
||||
path: ${{ github.workspace }}/checkstyle.zip
|
||||
- name: "Calculate Dubbo Version"
|
||||
id: dubbo-version
|
||||
run: |
|
||||
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
|
||||
echo "version=$REVISION" >> $GITHUB_OUTPUT
|
||||
echo "dubbo version: $REVISION"
|
||||
|
||||
unit-test-prepare:
|
||||
name: " Preparation for Unit Test On ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
env:
|
||||
ZOOKEEPER_VERSION: 3.6.3
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
- name: "Set up msys2 if necessary"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
release: false # support cache, see https://github.com/msys2/setup-msys2#context
|
||||
- name: "Download zookeeper binary archive in Linux OS"
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
- name: "Download zookeeper binary archive in Windows OS"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
|
||||
unit-test:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
unit-test-fastjson2:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }}, Serialization: fastjson2)"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
DUBBO_DEFAULT_SERIALIZATION: fastjson2
|
||||
MAVEN_SUREFIRE_ADD_OPENS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests on JDK 8"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests on JDK 8"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
samples-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
error-code-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
path: "./dubbo"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-test-tools'
|
||||
ref: main
|
||||
path: "./dubbo-test-tools"
|
||||
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: "Run Error Code Inspecting"
|
||||
env:
|
||||
DUBBO_ECI_REPORT_AS_ERROR: true
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
|
||||
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
|
||||
|
||||
- name: "Upload error code inspection result"
|
||||
# always() should not be used here, since we don't need to handle the 'canceled' situation.
|
||||
if: ${{ success() || failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.2"
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
nohup ./target/dubbo-demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
./target/dubbo-demo-native-consumer
|
||||
|
|
@ -1,502 +0,0 @@
|
|||
name: Build and Test Scheduled On 3.3
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0/6 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORK_COUNT: 2
|
||||
FAIL_FAST: 0
|
||||
SHOW_ERROR_DETAIL: 1
|
||||
#multi-version size limit
|
||||
VERSIONS_LIMIT: 4
|
||||
ALL_REMOTE_VERSION: true
|
||||
CANDIDATE_VERSIONS: '
|
||||
spring.version:5.3.24;
|
||||
spring-boot.version:2.7.6;
|
||||
'
|
||||
|
||||
jobs:
|
||||
license:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.3"
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
build-source:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.3"
|
||||
path: dubbo
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
- name: "Build Dubbo with Maven"
|
||||
run: |
|
||||
cd ./dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Pack checkstyle file if failure"
|
||||
if: failure()
|
||||
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
|
||||
- name: "Upload checkstyle file if failure"
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "checkstyle-file"
|
||||
path: ${{ github.workspace }}/checkstyle.zip
|
||||
- name: "Calculate Dubbo Version"
|
||||
id: dubbo-version
|
||||
run: |
|
||||
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
|
||||
echo "version=$REVISION" >> $GITHUB_OUTPUT
|
||||
echo "dubbo version: $REVISION"
|
||||
|
||||
unit-test-prepare:
|
||||
name: " Preparation for Unit Test On ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
env:
|
||||
ZOOKEEPER_VERSION: 3.6.3
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
- name: "Set up msys2 if necessary"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
release: false # support cache, see https://github.com/msys2/setup-msys2#context
|
||||
- name: "Download zookeeper binary archive in Linux OS"
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
- name: "Download zookeeper binary archive in Windows OS"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
|
||||
unit-test:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.3"
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
unit-test-fastjson2:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }}, Serialization: fastjson2)"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
DUBBO_DEFAULT_SERIALIZATION: fastjson2
|
||||
MAVEN_SUREFIRE_ADD_OPENS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests on JDK 8"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests on JDK 8"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
samples-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
error-code-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.3"
|
||||
path: "./dubbo"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-test-tools'
|
||||
ref: main
|
||||
path: "./dubbo-test-tools"
|
||||
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: "Run Error Code Inspecting"
|
||||
env:
|
||||
DUBBO_ECI_REPORT_AS_ERROR: true
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
|
||||
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
|
||||
|
||||
- name: "Upload error code inspection result"
|
||||
# always() should not be used here, since we don't need to handle the 'canceled' situation.
|
||||
if: ${{ success() || failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: "3.3"
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
nohup ./target/dubbo-demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
./target/dubbo-demo-native-consumer
|
||||
|
|
@ -1,497 +0,0 @@
|
|||
name: Release Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**-release'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORK_COUNT: 2
|
||||
FAIL_FAST: 0
|
||||
SHOW_ERROR_DETAIL: 1
|
||||
#multi-version size limit
|
||||
VERSIONS_LIMIT: 4
|
||||
ALL_REMOTE_VERSION: true
|
||||
CANDIDATE_VERSIONS: '
|
||||
spring.version:5.3.24;
|
||||
spring-boot.version:2.7.6;
|
||||
'
|
||||
|
||||
jobs:
|
||||
license:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check License
|
||||
uses: apache/skywalking-eyes@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
build-source:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: dubbo
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 8
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
- name: "Build Dubbo with Maven"
|
||||
run: |
|
||||
cd ./dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean source:jar install -Pjacoco,checkstyle -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Pack checkstyle file if failure"
|
||||
if: failure()
|
||||
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
|
||||
- name: "Upload checkstyle file if failure"
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "checkstyle-file"
|
||||
path: ${{ github.workspace }}/checkstyle.zip
|
||||
- name: "Calculate Dubbo Version"
|
||||
id: dubbo-version
|
||||
run: |
|
||||
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
|
||||
echo "version=$REVISION" >> $GITHUB_OUTPUT
|
||||
echo "dubbo version: $REVISION"
|
||||
|
||||
unit-test-prepare:
|
||||
name: " Preparation for Unit Test On ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
env:
|
||||
ZOOKEEPER_VERSION: 3.6.3
|
||||
steps:
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
- name: "Set up msys2 if necessary"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
release: false # support cache, see https://github.com/msys2/setup-msys2#context
|
||||
- name: "Download zookeeper binary archive in Linux OS"
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
- name: "Download zookeeper binary archive in Windows OS"
|
||||
if: ${{ startsWith( matrix.os, 'windows') && steps.cache-zookeeper.outputs.cache-hit != 'true' }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/.tmp/zookeeper
|
||||
wget -c https://archive.apache.org/dist/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c https://apache.website-solution.net/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.stu.edu.tw/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://apache.mirror.cdnetworks.com/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz ||
|
||||
wget -c http://mirror.apache-kr.org/apache/zookeeper/zookeeper-${{ env.ZOOKEEPER_VERSION }}/apache-zookeeper-${{ env.ZOOKEEPER_VERSION }}-bin.tar.gz -O ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
echo "list the downloaded zookeeper binary archive"
|
||||
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
|
||||
|
||||
unit-test:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
distribution: 'zulu'
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
unit-test-fastjson2:
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }}, Serialization: fastjson2)"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest ]
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
env:
|
||||
DISABLE_FILE_SYSTEM_TEST: true
|
||||
DUBBO_DEFAULT_SERIALIZATION: fastjson2
|
||||
MAVEN_SUREFIRE_ADD_OPENS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up JDK ${{ matrix.jdk }}"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: ${{ matrix.jdk }}
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache zookeeper binary archive"
|
||||
id: "cache-zookeeper"
|
||||
with:
|
||||
path: ${{ github.workspace }}/.tmp/zookeeper
|
||||
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
|
||||
restore-keys: |
|
||||
zookeeper-${{ runner.os }}-
|
||||
- name: "Test with Maven with Integration Tests on JDK 8"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests on JDK 8"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
- name: "Test with Maven with Integration Tests"
|
||||
timeout-minutes: 70
|
||||
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
|
||||
- name: "Test with Maven without Integration Tests"
|
||||
timeout-minutes: 90
|
||||
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
|
||||
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
|
||||
|
||||
samples-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-samples'
|
||||
ref: master
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: samples-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Prepare test list"
|
||||
run: |
|
||||
bash ./test/scripts/prepare-test.sh
|
||||
- name: "Upload test list"
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}} JavaVer: ${{matrix.jdk}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
job_id: [1, 2, 3, 4, 5]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Cache local Maven repository"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
${{ runner.os }}-maven-
|
||||
- name: "Restore Dubbo cache"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.m2/repository/org/apache/dubbo
|
||||
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
|
||||
${{ runner.os }}-dubbo-snapshot-
|
||||
- name: "Download test list"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-list
|
||||
path: test/jobs/
|
||||
- name: "Set up JDK ${{matrix.jdk}}"
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{matrix.jdk}}
|
||||
- name: "Init Candidate Versions"
|
||||
run: |
|
||||
DUBBO_VERSION="${{needs.build-source.outputs.version}}"
|
||||
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;compiler.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS;dubbo.compiler.version:$DUBBO_VERSION"
|
||||
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
|
||||
- name: "Build test image"
|
||||
run: |
|
||||
cd test && bash ./build-test-image.sh
|
||||
- name: "Run tests"
|
||||
run: cd test && bash ./run-tests.sh
|
||||
- name: "Upload test result"
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JAVA_VER: ${{matrix.jdk}}
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 8, 11, 17, 21 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-integration-cases'
|
||||
ref: main
|
||||
- name: "Download test result"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: integration-test-result-${{matrix.jdk}}
|
||||
path: test/jobs/
|
||||
- name: "Merge test result"
|
||||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
error-code-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'apache/dubbo-test-tools'
|
||||
ref: main
|
||||
path: "./dubbo-test-tools"
|
||||
|
||||
- name: "Set up JDK 21"
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 21
|
||||
distribution: 'zulu'
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
- name: "Run Error Code Inspecting"
|
||||
env:
|
||||
DUBBO_ECI_REPORT_AS_ERROR: true
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector
|
||||
../mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C package exec:java -Ddubbo.eci.report-as-error=${DUBBO_ECI_REPORT_AS_ERROR} -Dmaven.test.skip=true -Dmaven.test.skip.exec=true -Ddubbo.eci.path=${{ github.workspace }}/dubbo
|
||||
|
||||
- name: "Upload error code inspection result"
|
||||
# always() should not be used here, since we don't need to handle the 'canceled' situation.
|
||||
if: ${{ success() || failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "error-inspection-result"
|
||||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./dubbo"
|
||||
|
||||
- name: "Setup GraalVM environment"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
java --version
|
||||
native-image --version
|
||||
|
||||
- name: "Compile Dubbo (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo
|
||||
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
|
||||
|
||||
- name: "Compile and run Dubbo demo for native (Linux)"
|
||||
run: |
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
nohup ./target/dubbo-demo-native-provider &
|
||||
cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer
|
||||
${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile
|
||||
./target/dubbo-demo-native-consumer
|
||||
|
|
@ -1,18 +1,16 @@
|
|||
# maven ignore
|
||||
target/
|
||||
*.jar
|
||||
!.mvn/wrapper/*
|
||||
*.war
|
||||
*.zip
|
||||
*.tar
|
||||
*.tar.gz
|
||||
.flattened-pom.xml
|
||||
|
||||
# eclipse ignore
|
||||
.settings/
|
||||
.project
|
||||
.classpath
|
||||
.externalToolBuilders
|
||||
maven-eclipse.xml
|
||||
|
||||
# idea ignore
|
||||
.idea/
|
||||
|
|
@ -20,9 +18,6 @@ maven-eclipse.xml
|
|||
*.iml
|
||||
*.iws
|
||||
|
||||
# visual-studio-code ignore
|
||||
.vscode/
|
||||
|
||||
# temp ignore
|
||||
*.log
|
||||
*.cache
|
||||
|
|
@ -34,24 +29,3 @@ maven-eclipse.xml
|
|||
.DS_Store
|
||||
Thumbs.db
|
||||
*.orig
|
||||
|
||||
# license check result
|
||||
license-list
|
||||
|
||||
# grpc compiler
|
||||
compiler/gradle.properties
|
||||
compiler/build/*
|
||||
compiler/.gradle/*
|
||||
|
||||
# protobuf
|
||||
dubbo-serialization/dubbo-serialization-protobuf/build/*
|
||||
dubbo-demo/dubbo-demo-triple/build/*
|
||||
|
||||
# global registry center
|
||||
.tmp
|
||||
|
||||
.git.exec.error
|
||||
|
||||
# log files generated by testcase.
|
||||
dubbo-rpc/dubbo-rpc-api/custom-access.log*
|
||||
|
||||
|
|
|
|||
235
.licenserc.yaml
235
.licenserc.yaml
|
|
@ -1,235 +0,0 @@
|
|||
header:
|
||||
license:
|
||||
spdx-id: Apache-2.0
|
||||
content: |
|
||||
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.
|
||||
|
||||
paths-ignore:
|
||||
- '**/*.versionsBackup'
|
||||
- '**/.idea/'
|
||||
- '**/*.iml'
|
||||
- '**/.settings/*'
|
||||
- '**/.classpath'
|
||||
- '**/.project'
|
||||
- '**/target/**'
|
||||
- '**/generated/**'
|
||||
- '**/*.log'
|
||||
- '**/codestyle/*'
|
||||
- '**/resources/META-INF/**'
|
||||
- '**/resources/mockito-extensions/**'
|
||||
- '**/*.proto'
|
||||
- '**/*.cache'
|
||||
- '**/*.txt'
|
||||
- '**/*.load'
|
||||
- '**/*.flex'
|
||||
- '**/*.fc'
|
||||
- '**/*.javascript'
|
||||
- '**/*.properties'
|
||||
- '**/*.sh'
|
||||
- '**/*.bat'
|
||||
- '**/*.md'
|
||||
- '**/*.svg'
|
||||
- '**/*.png'
|
||||
- '**/*.json'
|
||||
- '**/*.conf'
|
||||
- '**/*.ftl'
|
||||
- '**/*.tpl'
|
||||
- '**/*.factories'
|
||||
- '**/*.handlers'
|
||||
- '**/*.schemas'
|
||||
- '**/*.nojekyll'
|
||||
- '.git/'
|
||||
- '.github/**'
|
||||
- '**/.gitignore'
|
||||
- '**/.helmignore'
|
||||
- '.repository/'
|
||||
- 'compiler/**'
|
||||
- '.gitmodules'
|
||||
- '.mvn'
|
||||
- 'mvnw'
|
||||
- 'mvnw.cmd'
|
||||
- 'LICENSE'
|
||||
- 'NOTICE'
|
||||
- 'CNAME'
|
||||
- 'Jenkinsfile'
|
||||
- '**/vendor/**'
|
||||
- '**/src/test/resources/certs/**'
|
||||
- '**/src/test/resources/definition/**'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocal.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalMap.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/HashedWheelTimer.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/Timeout.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/Timer.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/timer/TimerTask.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/utils/CIDRUtils.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/utils/Utf8Utils.java'
|
||||
- 'dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/EmbeddedZooKeeper.java'
|
||||
- 'dubbo-test/dubbo-test-common/src/main/java/org/apache/dubbo/test/common/utils/TestSocketUtils.java'
|
||||
- 'dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriHttp2RemoteFlowController.java'
|
||||
- 'dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutor.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractAotMojo.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/AbstractDependencyFilterMojo.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/CommandLineBuilder.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/DependencyFilter.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Exclude.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/ExcludeFilter.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/FilterableDependency.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/Include.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/IncludeFilter.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaCompilerPluginConfiguration.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaExecutable.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/JavaProcessExecutor.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/MatchingGroupIdFilter.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunArguments.java'
|
||||
- 'dubbo-maven-plugin/src/main/java/org/apache/dubbo/maven/plugin/aot/RunProcess.java'
|
||||
- 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/BasicJsonWriter.java'
|
||||
- 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/ExecutableMode.java'
|
||||
- 'dubbo-native/src/main/java/org/apache/dubbo/aot/generate/MemberCategory.java'
|
||||
- 'dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboMergingDigest.java'
|
||||
- 'dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/aggregate/DubboAbstractTDigest.java'
|
||||
|
||||
comment: on-failure
|
||||
|
||||
license-location-threshold: 130
|
||||
|
||||
dependency:
|
||||
files:
|
||||
- pom.xml
|
||||
- dubbo-dependencies-bom/pom.xml
|
||||
licenses:
|
||||
- name: com.alibaba.spring:spring-context-support
|
||||
license: Apache-2.0
|
||||
- name: com.fasterxml.jackson.core:jackson-annotations
|
||||
license: Apache-2.0
|
||||
- name: com.fasterxml.jackson.core:jackson-core
|
||||
license: Apache-2.0
|
||||
- name: com.fasterxml.jackson.core:jackson-databind
|
||||
license: Apache-2.0
|
||||
- name: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml
|
||||
license: Apache-2.0
|
||||
- name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310
|
||||
license: Apache-2.0
|
||||
- name: com.google.code.gson:gson
|
||||
license: Apache-2.0
|
||||
- name: com.google.guava:listenablefuture
|
||||
license: Apache-2.0
|
||||
- name: com.salesforce.servicelibs:grpc-contrib
|
||||
license: BSD 3-clause
|
||||
- name: com.squareup.okhttp3:logging-interceptor
|
||||
license: Apache-2.0
|
||||
- name: com.squareup.okhttp3:okhttp
|
||||
license: Apache-2.0
|
||||
- name: com.squareup.okio:okio
|
||||
license: Apache-2.0
|
||||
- name: com.sun.xml.fastinfoset:FastInfoset
|
||||
license: Apache-2.0
|
||||
- name: io.envoyproxy.controlplane:api
|
||||
license: Apache-2.0
|
||||
- name: io.swagger:swagger-annotations
|
||||
license: Apache-2.0
|
||||
- name: io.swagger:swagger-models
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-actuator
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-autoconfigure
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-configuration-processor
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-starter
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-starter-actuator
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-starter-logging
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-starter-tomcat
|
||||
license: Apache-2.0
|
||||
- name: org.springframework.boot:spring-boot-starter-web
|
||||
license: Apache-2.0
|
||||
- name: org.slf4j:slf4j-api
|
||||
license: MIT
|
||||
- name: org.slf4j:slf4j-log4j12
|
||||
license: MIT
|
||||
- name: org.jboss.resteasy:resteasy-jaxrs
|
||||
license: Apache-2.0
|
||||
- name: org.jboss.resteasy:resteasy-client
|
||||
license: Apache-2.0
|
||||
- name: org.jboss.resteasy:resteasy-netty4
|
||||
license: Apache-2.0
|
||||
- name: org.jboss.resteasy:resteasy-jdk-http
|
||||
license: Apache-2.0
|
||||
- name: org.jboss.resteasy:resteasy-jackson-provider
|
||||
license: Apache-2.0
|
||||
- name: org.jboss.resteasy:resteasy-jaxb-provider
|
||||
license: Apache-2.0
|
||||
- name: net.jcip:jcip-annotations
|
||||
license: Apache-2.0
|
||||
- name: org.apache.zookeeper:zookeeper
|
||||
license: Apache-2.0
|
||||
- name: org.apache.zookeeper:zookeeper-jute
|
||||
license: Apache-2.0
|
||||
- name: net.bytebuddy:byte-buddy
|
||||
license: Apache-2.0
|
||||
- name: javax.enterprise:cdi-api
|
||||
license: Apache-2.0
|
||||
- name: org.codehaus.plexus:plexus-component-annotations
|
||||
license: Apache-2.0
|
||||
- name: org.slf4j:jcl-over-slf4j
|
||||
license: Apache-2.0
|
||||
- name: org.slf4j:jul-to-slf4j
|
||||
license: Apache-2.0
|
||||
- name: org.codehaus.plexus:plexus-interpolation
|
||||
license: Apache-2.0
|
||||
- name: org.sonatype.plexus:plexus-sec-dispatcher
|
||||
license: Apache-2.0
|
||||
- name: org.sonatype.plexus:plexus-cipher
|
||||
license: Apache-2.0
|
||||
- name: com.google.protobuf:protobuf-java
|
||||
license: BSD 3-clause
|
||||
- name: com.google.protobuf:protobuf-java-util
|
||||
license: BSD 3-clause
|
||||
# multi license
|
||||
- name: org.javassist:javassist
|
||||
license: Apache-2.0
|
||||
- name: javax.annotation:javax.annotation-api
|
||||
license: CDDL-1.0
|
||||
- name: com.salesforce.servicelibs:jprotoc
|
||||
license: CDDL-1.0
|
||||
- name: org.checkerframework:checker-compat-qual
|
||||
license: MIT
|
||||
- name: ch.qos.logback:logback-classic
|
||||
license: EPL-1.0
|
||||
- name: ch.qos.logback:logback-core
|
||||
license: EPL-1.0
|
||||
- name: javax.servlet:javax.servlet-api
|
||||
license: CDDL-1.1
|
||||
- name: com.sun.activation:javax.activation
|
||||
license: CDDL-1.1
|
||||
- name: javax.activation:activation
|
||||
license: CDDL-1.1
|
||||
- name: jakarta.annotation:jakarta.annotation-api
|
||||
license: EPL-2.0
|
||||
- name: org.glassfish:jakarta.el
|
||||
license: EPL-2.0
|
||||
- name: org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec
|
||||
license: CDDL-1.1
|
||||
- name: org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec
|
||||
license: EPL-2.0
|
||||
- name: org.jboss.spec.javax.annotation:jboss-annotations-api_1.3_spec
|
||||
license: EPL-2.0
|
||||
excludes:
|
||||
- name: javax.xml.bind:jsr173_api
|
||||
Binary file not shown.
|
|
@ -1,18 +1 @@
|
|||
# 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
|
||||
#
|
||||
# https://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.
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
|
||||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
|
||||
|
|
|
|||
487
CHANGES.md
487
CHANGES.md
|
|
@ -1,398 +1,4 @@
|
|||
# Release Notes
|
||||
|
||||
Please refer to https://github.com/apache/dubbo/releases for notes of future releases.
|
||||
|
||||
## 2.7.6
|
||||
|
||||
### Features
|
||||
* Support Service Authentication https://github.com/apache/dubbo/issues/5461
|
||||
|
||||
### Enhancement
|
||||
* Removing the internal JDK API from FileSystemDynamicConfiguration
|
||||
* Refactor the APT test-cases implementation of dubbo-metadata-processor in Java 9+
|
||||
* Remove feature envy
|
||||
* JsonRpcProtocol support Generalization
|
||||
* Reduce object allocation for ProtocolUtils.serviceKey
|
||||
* Reduce object allocation for ContextFilter.invoke
|
||||
|
||||
### Bugfixes
|
||||
* Fixed bugs reported from 2.7.5 or lower versions, check [2.7.6 milestone](https://github.com/apache/dubbo/milestone/30) for details.
|
||||
|
||||
### Compatibility
|
||||
1. Filter refactor, the callback method `onResponse` annotated as @Deprecated has been removed, users of lower versions that
|
||||
have extended Filter implementations and enabled Filter callbacks should be careful of this change.
|
||||
2. RpcContext added some experimental APIs to support generic Object transmission.
|
||||
|
||||
## 2.7.5
|
||||
|
||||
### Features
|
||||
* Support HTTP/2 through gRPC, offers all features supported by HTTP/2 and gRPC
|
||||
* Stream communication: client stream, server stream and bi-stream.
|
||||
* Reactive stream style RPC call.
|
||||
* Back pressure based on HTTP/2 flow-control mechanism.
|
||||
* TLS secure transport layer.
|
||||
* Define service using IDL
|
||||
* Protobuf support for native Dubbo
|
||||
* Define service using IDL
|
||||
* Protobuf serialization
|
||||
* TLS for netty4 server
|
||||
* New SPI for dynamically adding extra parameters into provider URL, especially env parameters.
|
||||
* **[BETA]** Brand new Service Discovery mechanism: Service Reflection - instance (application) level service discovery.
|
||||
* **[BETA]** Brand new API for bootstraping Dubbo projects
|
||||
|
||||
### Performance Tuning
|
||||
* Overall performance improved by nearly 30% compared to v2.7.3 (by QPS in certain circumstances)
|
||||
* Improved consumer side thread model to avoid thread allocation and context switch, especially useful for services serving big traffic.
|
||||
|
||||
### Enhancement
|
||||
* Load balance strategy among multiple registries:
|
||||
* Preferred
|
||||
* Same zone first
|
||||
* Weighted LB
|
||||
* The first one available
|
||||
* New callback SPI for receiving address change notifications
|
||||
* Refactoring of config module
|
||||
|
||||
### Bugfixes
|
||||
check 2.7.5 milestone for details.
|
||||
|
||||
## 2.7.4.1
|
||||
|
||||
### Enhancement
|
||||
|
||||
* Enhance ProtobufTypeBuilder support generate type definition which contains Bytes List or Bytes Map. #5083
|
||||
* Using the ID of Dubbo Config as the alias of Bean. #5094
|
||||
* tag router supports anyhost. #4431
|
||||
* optimize generic invoke. #4076
|
||||
* dubbo zookeeper registry too slow #4828
|
||||
* use consul with group and version. #4755
|
||||
* qos support host config. #4720
|
||||
* migrate http protocol #4781
|
||||
* Some unit test optimization. #5026 #4803 #4687
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Apollo namespace optimization. #5105
|
||||
* Simplify dubbo-common transitive dependencies. #5107
|
||||
* Delete 'config.' prefix for url generated from ConfigCenterConfig. #5001
|
||||
* fix set generic method error. #5079
|
||||
* Add support for overriding Map properties in AbstractConfig.refresh. #4882
|
||||
* Fix travis javax.ex dependency issue. (unit test)
|
||||
* Fix: ExtensionLoader load duplicate filter,no log or exception. #4340
|
||||
* When the provider interrupts abnormally, the consumer cannot return quickly and still waits for the timeout to end. #4694
|
||||
* Fix register config not take effect because of url simplified。 #4397
|
||||
* Don't support metadata for generic service. #4641
|
||||
* Avoid resize in ClassUtils.java. #5009
|
||||
* default attribute in <dubbo:registry> doesn't work as expected. #4412
|
||||
* make RegistryDirectory can refresh the invokers when providers number become 0 when using nacos registry. #4793
|
||||
* Multiple @Reference annotations only have one effect #4674
|
||||
* Fix RpcContext.getContext().getRemoteApplicationName() returns null #4351
|
||||
* Security issue: upgrade fastjson version to 1.2.60. #5018
|
||||
* nacos-registry:serviceName split error #4974
|
||||
* AbstractConfig.java-getMetaData set default depend on getmethod sequence #4678
|
||||
* fix protocol register set false not work. #4776
|
||||
* Fix: In Rest protocol, the limitation of Dubbo-Attachments. #4898
|
||||
* The logic of org.apache.dubbo.config.MonitorConfig#isValid is incorrect #4892
|
||||
* protostuff return stackoverflow and other error msg #4861
|
||||
* fix method parameter bean generation. #3796
|
||||
* replace hardcode with regex pattern #4810
|
||||
* Fix warm up issue when provider's timestamp is bigger than local machine's timestamp. #4870
|
||||
* Fix use generic invocation via API , lost #4238 ion" value #4784
|
||||
* In consumer side the app cannot catch the exception from provider that is configured serialization="kryo". #4238
|
||||
* fix StringUtils#isBlank #4725
|
||||
* when the interfaceName of the Reference annotation has duplicated,the exception is puzzled #4160
|
||||
* when anonymity bean is defined in spring context,dubbo throw npe #
|
||||
* add Thread ContextClassLoader #4712
|
||||
* Fix judgment ipv4 address #4729
|
||||
* The compilation of static methods should be excluded when generating the proxy. #4647
|
||||
* check EOF of inputstream in IOUtils.write #4648
|
||||
|
||||
|
||||
## 2.7.3
|
||||
|
||||
### Change List
|
||||
|
||||
1. Asynchronous support
|
||||
* Unified asynchronous and synchronous callback process, exception scenario triggers onError callback, #4401
|
||||
* Performance degradation caused by CompletableFuture.get() in JDK1.8 environment, #4279
|
||||
|
||||
2. Configuration Center
|
||||
* ConfigCenter custom namespace does not take effect, #4411
|
||||
* Unify the models implemented by several configuration centers such as Zookeeper, Nacos, and Etcd. Please refer to the description for possible incompatibility issues, #4388
|
||||
* Adjust Override Coverage Rule Center Priority: Service Level > Application Level, #4175
|
||||
|
||||
3. 2.6.x compatibility
|
||||
* Support Zipkin tracing feature provided by Zipkin officially, #3728, #4471
|
||||
* DubboComponentScan supports simultaneous scanning of annotations under the `com.alibaba.*` and `org.apache.*` packages, #4330
|
||||
|
||||
4. The Nacos Registration Center only subscribes to the address list and no longer subscribes to configuration information, #4454.
|
||||
|
||||
5. Support to read the environment configuration from the specified location, which can be specified by -D or OS VARIABLE. Please refer to [automatically loading environment variables](http://dubbo.apache.org/en-us/docs/user/configuration/environment-variables.html)
|
||||
|
||||
6. Fix consumer cannot downgrade to providers with no tags when there's no tagged providers can match, #4525
|
||||
|
||||
7. Some other bugfixes, #4346 #4338 #4349 #4377
|
||||
|
||||
### Change List
|
||||
|
||||
1. 异步支持相关
|
||||
|
||||
- 统一异步和同步的回调流程,异常场景触发onError回调 #4401
|
||||
- CompletableFuture.get()在JDK1.8环境下带来的性能下降问题 #4279
|
||||
|
||||
2. 配置中心相关
|
||||
|
||||
- ConfigCenter自定义namespace不生效的问题 #4411
|
||||
- 统一Zookeeper、Nacos、Etcd等几个配置中心实现的模型,可能带来的不兼容性问题请参见说明。相关修改:#4388
|
||||
- 调整Override覆盖规则中心优先级:服务级别 > 应用级别 #4175
|
||||
|
||||
3. 2.6.x兼容性
|
||||
|
||||
- 兼容zipkin官方提供的基于Dubbo-2.6 API的集成 #3728, #4471
|
||||
- DubboComponentScan支持同时扫描 `com.alibaba.*` 和 `org.apache.*` 两个包下的注解 #4330
|
||||
|
||||
4. Nacos注册中心只订阅地址列表,不再订阅配置信息 #4454
|
||||
|
||||
5. 支持从指定位置读取环境配置,可通过-D或OS VARIABLE指定,具体请参见[使用说明](http://dubbo.apache.org/zh-cn/docs/user/configuration/environment-variables.html)
|
||||
|
||||
6. 标签路由在消费端使用静态打标方式时,无法实现自动降级以消费无标签提供者 #4525
|
||||
|
||||
7. 其他一些bugfix,#4346 #4338 #4349 #4377
|
||||
|
||||
## 2.7.2
|
||||
|
||||
### New Features
|
||||
|
||||
- nacos config center / metadata center support. [#3846](https://github.com/apache/dubbo/issues/3846)
|
||||
- Etcd support as config center and metadata center [#3653](https://github.com/apache/dubbo/issues/3653)
|
||||
- Support Redis cluster in Metadata Report. [#3817](https://github.com/apache/dubbo/issues/3817)
|
||||
- add new module for Dubbo Event. [#4096](https://github.com/apache/dubbo/issues/4096)
|
||||
- Support multiple registry that including some effective registry, such as zk, redis [#3599](https://github.com/apache/dubbo/issues/3599)
|
||||
- support nacos metadata [#4025](https://github.com/apache/dubbo/issues/4025)
|
||||
- Dubbo support Google Protobuf generic reference [#3829](https://github.com/apache/dubbo/issues/3829)
|
||||
- Merge serialization-native-hessian-for-apache-dubbo into incubator-dubbo [#3961](https://github.com/apache/dubbo/issues/3961)
|
||||
- Merge rpc-native-thrift-for-apache-dubbo into incubator-dubbo [#3960](https://github.com/apache/dubbo/issues/3960)
|
||||
- add socks5 proxy support [#3624](https://github.com/apache/dubbo/issues/3624)
|
||||
- Integrate with SOFARegistry [#3874](https://github.com/apache/dubbo/issues/3874)
|
||||
- Introduce CompletableFuture $invokeAsync for GenericService, now, for generic call, you can use:
|
||||
$invoke for sync method call with normal return type.
|
||||
$invokeAsync for async method call with CompletableFuture<T> signature. [#3163](https://github.com/apache/dubbo/issues/3163)
|
||||
|
||||
### Enhancement
|
||||
|
||||
- Performance tuning for TimeoutTask in DefaultFuture. [#4129](https://github.com/apache/dubbo/issues/4129)
|
||||
- Add a script to check dependencies license. [#3840](https://github.com/apache/dubbo/issues/3840)
|
||||
- Change DynamicConfiguration definition to better adapt to Apollo's namespace storage model.[#3266](https://github.com/apache/dubbo/issues/3266)
|
||||
- use equal explicit class to replace anonymous class [#4027](https://github.com/apache/dubbo/issues/4027)
|
||||
- Separate Constants.java into some SubConstants Class [#3137](https://github.com/apache/dubbo/issues/3137)
|
||||
- Need to enhance DecodeableRpcResult error message [#3994](https://github.com/apache/dubbo/issues/3994)
|
||||
- Provide more meaningful binary releases. [#2491](https://github.com/apache/dubbo/issues/2491)
|
||||
- remove useless module-dubbo-test-integration [#3573](https://github.com/apache/dubbo/issues/3573)
|
||||
- complete lookup method of consul registry and add integration test [#3890](https://github.com/apache/dubbo/issues/3890)
|
||||
- Metrics Service [#3702](https://github.com/apache/dubbo/issues/3702)
|
||||
- Update nacos-client to 1.0.0 [#3804](https://github.com/apache/dubbo/issues/3804)
|
||||
- Fluent style builder API support [#3431](https://github.com/apache/dubbo/issues/3431)
|
||||
- Update readme to remove the incubator prefix [#4159](https://github.com/apache/dubbo/issues/4159)
|
||||
- update erlang link [#4100](https://github.com/apache/dubbo/issues/4100)
|
||||
- optimize array code style [#4031](https://github.com/apache/dubbo/issues/4031)
|
||||
- optimize some code style [#4006](https://github.com/apache/dubbo/issues/4006)
|
||||
- remove useless module-dubbo-test-integration [#3989](https://github.com/apache/dubbo/issues/3989)
|
||||
- optimize constant naming style [#3970](https://github.com/apache/dubbo/issues/3970)
|
||||
- Use maven CI friendly versions: revision. [#3851](https://github.com/apache/dubbo/issues/3851)
|
||||
- remove-parse-error-log [#3862](https://github.com/apache/dubbo/issues/3862)
|
||||
- Complete xsd definition for ConfigCenterConfig. [#3854](https://github.com/apache/dubbo/issues/3854)
|
||||
- add remoteApplicationName field in RpcContext [#3816](https://github.com/apache/dubbo/issues/3816)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- @Reference can't match the local @Service beans. [#4071](https://github.com/apache/dubbo/issues/4071)
|
||||
- remove some illegal licence: jcip-annotations, jsr173_api. [#3790](https://github.com/apache/dubbo/issues/3790)
|
||||
- Qos port can't be disabled by externalized property. [#3958](https://github.com/apache/dubbo/issues/3958)
|
||||
- Fix consumer will generate wrong stackTrace. [#4137](https://github.com/apache/dubbo/issues/4137)
|
||||
- nacos registry serviceName may conflict. [#4111](https://github.com/apache/dubbo/issues/4111)
|
||||
- The client loses the listener when the network is reconnected. [#4115](https://github.com/apache/dubbo/issues/4115)
|
||||
- fix registry urls increase forever when recreate reference proxy. [#4109](https://github.com/apache/dubbo/issues/4109)
|
||||
- In dubbo 2.7.1,the watcher processor of zookeeper client throw Nullpointexception. [#3866](https://github.com/apache/dubbo/issues/3866)
|
||||
- ReferenceConfig initialized not changed to false once subscribe throws exception [#4068](https://github.com/apache/dubbo/issues/4068)
|
||||
- dubbo registry extension compatibility with dubbo 2.6.x. [#3882](https://github.com/apache/dubbo/issues/3882)
|
||||
- Annotation mode cannot set service parameters in 2.7.0. [#3778](https://github.com/apache/dubbo/issues/3778)
|
||||
- compatibility with Zipkin. [#3728](https://github.com/apache/dubbo/issues/3728)
|
||||
- do local export before register any listener. [#3669](https://github.com/apache/dubbo/issues/3669)
|
||||
- Cannot recognize 2.6.x compatible rules from dubbo-admin. [#4059](https://github.com/apache/dubbo/issues/4059)
|
||||
- In Dubbo 2.7.0, the provider can't be configured to async [#3650](https://github.com/apache/dubbo/issues/3650)
|
||||
- dubbox compatibility [#3991](https://github.com/apache/dubbo/issues/3991)
|
||||
- dubbo-2.7.1 providers repeat register [#3785](https://github.com/apache/dubbo/issues/3785)
|
||||
- consul registry: NullPointerException [#3923](https://github.com/apache/dubbo/issues/3923)
|
||||
- cannot publish local ip address when local ip and public ip exist at the same time [#3802](https://github.com/apache/dubbo/issues/3802)
|
||||
- roll back change made by 3520. [#3935](https://github.com/apache/dubbo/issues/3935)
|
||||
- dubbo-registry-nacos module is not bundled into Apache Dubbo 2.7.1 [#3797](https://github.com/apache/dubbo/issues/3797)
|
||||
- switch from CopyOnWriteArrayList to regular list in order to avoid potential UnsupportedOperationException [#3242](https://github.com/apache/dubbo/issues/3242)
|
||||
- Serialization ContentTypeId conflict between avro protocol and protocoluff protocol [#3926](https://github.com/apache/dubbo/issues/3926)
|
||||
- delay export function doesn't work. [#3952](https://github.com/apache/dubbo/issues/3952)
|
||||
- org.apache.dubbo.rpc.support.MockInvoker#getInterface should not return null [#3713](https://github.com/apache/dubbo/issues/3713)
|
||||
- dubbo TagRouter does not work with dubbo:parameter [#3875](https://github.com/apache/dubbo/issues/3875)
|
||||
- make protocols a mutable list (a concrete ArrayList) [#3841](https://github.com/apache/dubbo/issues/3841)
|
||||
- javadoc lint issue [#3646](https://github.com/apache/dubbo/issues/3646)
|
||||
- The etcd3 lease should be recycled correctly [#3684](https://github.com/apache/dubbo/issues/3684)
|
||||
- telnet can't work when parameter has no nullary constructor and some fields is primitive [#4007](https://github.com/apache/dubbo/issues/4007)
|
||||
- Sort added router list before set the 'routers' field of the RouterChain [#3969](https://github.com/apache/dubbo/issues/3969)
|
||||
- fix injvm and local call [#3638](https://github.com/apache/dubbo/issues/3638)
|
||||
- spelling error in org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator#generateReturnAndInovation [#3933](https://github.com/apache/dubbo/issues/3933)
|
||||
- metadata report doesn't support redis with password [#3826](https://github.com/apache/dubbo/issues/3826)
|
||||
- The dubbo protostuff protocol serializes the bug of java.sql.Timestamp [#3914](https://github.com/apache/dubbo/issues/3914)
|
||||
- do not filter thread pool by port [#3919](https://github.com/apache/dubbo/issues/3919)
|
||||
- 'dubbo-serialization-gson' maven package error [#3903](https://github.com/apache/dubbo/issues/3903)
|
||||
- AbstractRegistry will be endless loop, when doSaveProperties method have no permission to save the file [#3746](https://github.com/apache/dubbo/issues/3746)
|
||||
- fix fastjson serialization with generic return type [#3771](https://github.com/apache/dubbo/issues/3771)
|
||||
- The dubbo-serialization -api modules should not dependency on third-party jar packages [#3762](https://github.com/apache/dubbo/issues/3762)
|
||||
- when using protostuff to serialize, there is not to check whether the data is null [#3727](https://github.com/apache/dubbo/issues/3727)
|
||||
- bugfix and enhancement for async [#3287](https://github.com/apache/dubbo/issues/3287)
|
||||
|
||||
## 2.7.1
|
||||
|
||||
### Notice
|
||||
|
||||
'zkclient' extension for 'org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter' is removed from Dubbo 2.7.1, and 'curator' extension becomes the default extension. If you happen to config your application to use 'zkclient' explicitly, pls. switch to use 'curator' instead.
|
||||
|
||||
### New Features
|
||||
|
||||
- service register support on nacos [#3582](https://github.com/apache/dubbo/issues/3582)
|
||||
- support consul as registry center, config center and metadata center [#983](https://github.com/apache/dubbo/issues/983)
|
||||
- service registry support/config center support on etcd [#808](https://github.com/apache/dubbo/issues/808)
|
||||
- metrics support in dubbo 2.7.1 [#3598](https://github.com/apache/dubbo/issues/3598)
|
||||
- @Argument @Method support [#2405](https://github.com/apache/dubbo/issues/2045)
|
||||
|
||||
### Enhancement
|
||||
|
||||
- [Enhancement] @EnableDubboConfigBinding annotates @Repeatable [#1770](https://github.com/apache/dubbo/issues/1770)
|
||||
- [Enhancement] Change the default behavior of @EnableDubboConfig.multiple() [#3193](https://github.com/apache/dubbo/issues/3193)
|
||||
- Should make annotation easier to use in multiple items circumstance [#3039](https://github.com/apache/dubbo/issues/3039)
|
||||
- NoSuchMethodError are thrown when add custom Filter using dubbo2.6.5 and JDK1.6 and upgrade to dubbo2.7.0 [#3570](https://github.com/apache/dubbo/issues/3570)
|
||||
- introduce dubbo-dependencies-zookeeper [#3607](https://github.com/apache/dubbo/pull/3607)
|
||||
- Zookeeper ConfigCenter reuse the client abstraction and connection session [#3288](https://github.com/apache/dubbo/issues/3288)
|
||||
- [Survey] Is it necessary to continue to maintain zkclient in dubbo project? [#3569](https://github.com/apache/dubbo/issues/3569)
|
||||
- Start to use IdleStateHandler in Netty4 [#3341](https://github.com/apache/dubbo/pull/3341)
|
||||
- Support multiple shared links [#2457](https://github.com/apache/dubbo/pull/2457)
|
||||
- Optimize heartbeat [#3299](https://github.com/apache/dubbo/pull/3299)
|
||||
- AccessLogFilter simple date format reduce instance creation [#3026](https://github.com/apache/dubbo/issues/3026)
|
||||
- Support wildcard ip for tag router rule. [#3289](https://github.com/apache/dubbo/issues/3289)
|
||||
- ScriptRouter should cache CompiledScript [#390](https://github.com/apache/dubbo/issues/390)
|
||||
- Optimize compareTo in Router to guarantee consistent behaviour. [#3302](https://github.com/apache/dubbo/issues/3302)
|
||||
- RMI protocol doesn't support generic invocation [#2779](https://github.com/apache/dubbo/issues/2779)
|
||||
- a more elegant way to enhance HashedWheelTimer [#3567](https://github.com/apache/dubbo/pull/3567)
|
||||
- obtain local address incorrectly sometimes in dubbo [#538](https://github.com/apache/dubbo/issues/538)
|
||||
- implement pull request #3412 on master branch [#3418](https://github.com/apache/dubbo/pull/3418)
|
||||
- enhancement for event of response (follow up for pull request #3043) [#3244](https://github.com/apache/dubbo/issues/3244)
|
||||
- bump up hessian-lite version #3423 [#3513](https://github.com/apache/dubbo/pull/3513)
|
||||
- [Dubbo-3610]make snakeyaml transitive, should we do this? [#3659](https://github.com/apache/dubbo/pull/3659)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
- cannot register REST service in 2.7 due to the changes in RestProtoco#getContextPath [#3445](https://github.com/apache/dubbo/issues/3445)
|
||||
- Conflict between curator client and dubbo [#3574](https://github.com/apache/dubbo/issues/3574)
|
||||
- is there a problem in NettyBackedChannelBuffer.setBytes(...)? [#2619](https://github.com/apache/dubbo/issues/2619)
|
||||
- [Dubbo - client always reconnect offline provider] Dubbo client bug [#3158](https://github.com/apache/dubbo/issues/3158)
|
||||
- fix heartbeat internal [#3579](https://github.com/apache/dubbo/pull/3579)
|
||||
- logic issue in RedisRegistry leads to services cannot be discovered. [#3291](https://github.com/apache/dubbo/pull/3291)
|
||||
- Multicast demo fails with message "Can't assign requested address" [#2423](https://github.com/apache/dubbo/issues/2423)
|
||||
- Fix thrift protocol, use path to locate exporter. [#3331](https://github.com/apache/dubbo/pull/3331)
|
||||
- cannot use override to modify provider's configuration when hessian protocol is used [#900](https://github.com/apache/dubbo/issues/900)
|
||||
- Condition is not properly used ? [#1917](https://github.com/apache/dubbo/issues/1917)
|
||||
- connectionMonitor in RestProtocol seems not work [#3237](https://github.com/apache/dubbo/issues/3237)
|
||||
- fail to parse config text with white space [#3367](https://github.com/apache/dubbo/issues/3367)
|
||||
- @Reference check=false doesn't take effect [#195](https://github.com/apache/dubbo/issues/195)
|
||||
- [Issue] SpringStatusChecker execute errors on non-XML Spring configuration [#3615](https://github.com/apache/dubbo/issues/3615)
|
||||
- monitor's cluster config is set to failsafe and set to failsafe only [#274](https://github.com/apache/dubbo/issues/274)
|
||||
- A question for ReferenceConfigCache. [#1293](https://github.com/apache/dubbo/issues/1293)
|
||||
- referenceconfig#destroy never invoke unregister [#3294](https://github.com/apache/dubbo/issues/3294)
|
||||
- Fix when qos is disable,log will print every time [#3397](https://github.com/apache/dubbo/pull/3397)
|
||||
- service group is not supported in generic direct invocation [#3555](https://github.com/apache/dubbo/issues/3555)
|
||||
- setOnreturn doesn't take effect in async generic invocation [#208](https://github.com/apache/dubbo/issues/208)
|
||||
- Fix timeout filter not work in async way [#3174](https://github.com/apache/dubbo/pull/3174)
|
||||
- java.lang.NumberFormatException: For input string: "" [#3069](https://github.com/apache/dubbo/issues/3069)
|
||||
- NPE occurred when the configuration was deleted [#3533](https://github.com/apache/dubbo/issues/3533)
|
||||
- NPE when package of interface is empty [#3556](https://github.com/apache/dubbo/issues/3556)
|
||||
- NPE when exporting rest service using a given path. [#3477](https://github.com/apache/dubbo/issues/3477)
|
||||
- NullPointerException happened when using SpringContainer.getContext() [#3476](https://github.com/apache/dubbo/issues/3476)
|
||||
- Why does not tomcat throw an exception when `server.start` failed with a socket binding error. [#3236](https://github.com/apache/dubbo/issues/3236)
|
||||
- No such extension org.apache.dubbo.metadata.store.MetadataReportFactory by name redis [#3514](https://github.com/apache/dubbo/issues/3514)
|
||||
- dubbo 2.7.1-SNAPSHOT NoClassDefFoundError when use springboot [#3426](https://github.com/apache/dubbo/issues/3426)
|
||||
- NPE occurs when use @Reference in junit in spring boot application [#3429](https://github.com/apache/dubbo/issues/3429)
|
||||
- When refer the same service with more than one @References(with different configs) on consumer side, only one take effect [#1306](https://github.com/apache/dubbo/issues/1306)
|
||||
- consumer always catch java.lang.reflect.UndeclaredThrowableException for the exception thrown from provider [#3386](https://github.com/apache/dubbo/issues/3386)
|
||||
- dubbo2.7.0 com.alibaba.com.caucho.hessian.io.HessianProtocolException: 'com.alibaba.dubbo.common.URL' could not be instantiated [#3342](https://github.com/apache/dubbo/issues/3342)
|
||||
- Close Resources Properly [#3473](https://github.com/apache/dubbo/issues/3473)
|
||||
- SPI entires dup by 3 times. [#2842](https://github.com/apache/dubbo/issues/2842)
|
||||
- provider gets wrong interface name from attachment when use generic invocation in 2.6.3 [#2981](https://github.com/apache/dubbo/issues/2981)
|
||||
- HashedWheelTimer's queue gets full [#3449](https://github.com/apache/dubbo/issues/3449)
|
||||
- Modify MetadataReportRetry ThreadName [#3550](https://github.com/apache/dubbo/pull/3550)
|
||||
- Keep interface key in the URL in simplify mode when it's different from path. [#3478](https://github.com/apache/dubbo/issues/3478)
|
||||
- nc is not stable in dubbo's bootstrap script [#936](https://github.com/apache/dubbo/issues/936)
|
||||
|
||||
## 2.7.0
|
||||
|
||||
Requirements: **Java 8+** required
|
||||
|
||||
Please check [here](https://github.com/apache/dubbo/blob/2.7.0-release/CHANGES.md#upgrading-and-compatibility-notifications) for notes and possible compatibility issues for upgrading from 2.6.x or lower to 2.7.0.
|
||||
|
||||
### New Features
|
||||
|
||||
- Enhancement of service governance rules.
|
||||
- Enriched Routing Rules.
|
||||
1. Conditional Routing. Supports both application-level and service-level conditions.
|
||||
2. Tag Routing. Newly introduced to better support traffic isolation, such as grey deployment.
|
||||
- Decoupling governance rules with the registry, making it easier to extend. Apollo and Zookeeper are available in this version. Nacos support is on the way...
|
||||
- Application-level Dynamic Configuration support.
|
||||
- Use YAML as the configuration language, which is more friendly to read and use.
|
||||
|
||||
- Externalized Configuration. Supports reading `dubbo.properties` hosted in remote centralized configuration center - centralized configuration.
|
||||
|
||||
- Simplified registry URL. With lower Registry memory use and less notification pressure from Service Directory, separates Configuration notification from Service Discovery.
|
||||
|
||||
- Metadata Center. A totally new concept since 2.7.0, used to store service metadata including static configuration, service definition, method signature, etc.. By default, Zookeeper and Redis are supported as the backend storage. Will work as the basis of service testing, mock and other service governance features going to be supported in [Dubbo-Admin](https://github.com/apache/dubbo-admin).
|
||||
|
||||
- Asynchronous Programming Model (only works for Dubbo protocol now)
|
||||
- Built-in support for the method with CompletableFuture<T> signature.
|
||||
- Server-side asynchronous support, with an AsyncContext API works like Servlet 3.0.
|
||||
- Asynchronous filter chain callback.
|
||||
|
||||
- Serialization Extension: Protobuf.
|
||||
|
||||
- Caching Policy Extension: Expiring Cache.
|
||||
|
||||
### Enhancements / Bugfixes
|
||||
|
||||
- Load Balancing strategy enhancement: ConsitentHash #2190, LeastActive #2171, Random #2597, RoundRobin #2650.
|
||||
|
||||
- Third-party dependency upgrading.
|
||||
- Switch default remoting to Netty 4.
|
||||
- Switch default Zookeeper client to Curator.
|
||||
- Upgrade Jetty to 9.x.
|
||||
|
||||
- IPV6 support #2079.
|
||||
|
||||
- Performance tuning, check hanging requests on a closed channel, make them return directly #2185.
|
||||
|
||||
- Fixed the serialization problem of JDK primitive types in Kryo #2178.
|
||||
|
||||
- Fixed the problem of failing to notify Consumer as early as possible after the Provider side deserialization failed #1903.
|
||||
|
||||
### Upgrading and Compatibility Notifications
|
||||
|
||||
We have always keep compatibility in mind during the whole process of 2.7.0. We even want old users to upgrade with only on pom version upgrade, but it's hard to achieve that, especially when considering that we have the package renamed in this version, so we had some tradeoffs. If you only used the Dubbo's most basic features, you may have little problems of upgrading, but if you have used some advanced features or have some SPI extensions inside, you'd better read the upgrade notifications carefully. The compatibility issues can be classified into the following 5 categories, for each part, there will have detailed dos and don'ts published later in the official website.
|
||||
|
||||
1. Interoperability between 2.7.0 and lower versions
|
||||
|
||||
2. Package renaming
|
||||
|
||||
com.alibaba.dubbo -> org.apache.dubbo
|
||||
|
||||
3. Simplification of registered URLs
|
||||
|
||||
4. Service Governance Rules
|
||||
|
||||
5. Configuration
|
||||
|
||||
## 2.6.6
|
||||
|
||||
Enhancement / New feature:
|
||||
|
|
@ -400,7 +6,7 @@ Enhancement / New feature:
|
|||
* tag route. #3065
|
||||
* Use Netty4 as default Netty version. #3029
|
||||
* upporting Java 8 Date/Time type when serializing with Kryo #3519
|
||||
* support config telnet #3511
|
||||
* supoort config telnet #3511
|
||||
* add annotation driven in MethodConfig and ArgumentConfig #2603
|
||||
* add nacos-registry module #3296
|
||||
* add `protocol` attribute in `@Rerefence` #3555
|
||||
|
|
@ -416,7 +22,7 @@ BugFix:
|
|||
* SPI entires dup by 3 times #3315
|
||||
* fix Consumer throws RpcException after RegistryDirectory notify in high QPS #2016
|
||||
* fix NPE in @Reference when using Junit to test dubbo service #3429
|
||||
* fix consumer always catch java.lang.reflect.UndeclaredThrowableException for any exception throws in provider #3386
|
||||
* fix consuer always catch java.lang.reflect.UndeclaredThrowableException for any exception throws in provider #3386
|
||||
* fix the priority of `DubboConfigConfigurationSelector ` #2897
|
||||
* fix `@Rerefence#parameters()` not work #2301
|
||||
|
||||
|
|
@ -424,57 +30,57 @@ BugFix:
|
|||
|
||||
Enhancements / Features:
|
||||
|
||||
- Reactor the generation rule for @Service Bean name [#2235](https://github.com/apache/dubbo/issues/2235)
|
||||
- Introduce a new Spring ApplicationEvent for ServiceBean exporting [#2251](https://github.com/apache/dubbo/issues/2251)
|
||||
- [Enhancement] the algorithm of load issue on Windows. [#1641](https://github.com/apache/dubbo/issues/1641)
|
||||
- add javadoc to dubbo-all module good first issue. [#2600](https://github.com/apache/dubbo/issues/2600)
|
||||
- [Enhancement] Reactor the generation rule for @Service Bean name type/enhancement [#2235](https://github.com/apache/dubbo/issues/2235)
|
||||
- Optimize LeastActiveLoadBalance and add weight test case. [#2540](https://github.com/apache/dubbo/issues/2540)
|
||||
- Smooth Round Robin selection. [#2578](https://github.com/apache/dubbo/issues/2578) [#2647](https://github.com/apache/dubbo/pull/2647)
|
||||
- [Enhancement] Resolve the placeholders for sub-properties. [#2297](https://github.com/apache/dubbo/issues/2297)
|
||||
- Add ability to turn off SPI auto injection, special support for generic Object type injection. [#2681](https://github.com/apache/dubbo/pull/2681)
|
||||
- Reactor the generation rule for @Service Bean name [#2235](https://github.com/apache/incubator-dubbo/issues/2235)
|
||||
- Introduce a new Spring ApplicationEvent for ServiceBean exporting [#2251](https://github.com/apache/incubator-dubbo/issues/2251)
|
||||
- [Enhancement] the algorithm of load issue on Windows. [#1641](https://github.com/apache/incubator-dubbo/issues/1641)
|
||||
- add javadoc to dubbo-all module good first issue. [#2600](https://github.com/apache/incubator-dubbo/issues/2600)
|
||||
- [Enhancement] Reactor the generation rule for @Service Bean name type/enhancement [#2235](https://github.com/apache/incubator-dubbo/issues/2235)
|
||||
- Optimize LeastActiveLoadBalance and add weight test case. [#2540](https://github.com/apache/incubator-dubbo/issues/2540)
|
||||
- Smooth Round Robin selection. [#2578](https://github.com/apache/incubator-dubbo/issues/2578) [#2647](https://github.com/apache/incubator-dubbo/pull/2647)
|
||||
- [Enhancement] Resolve the placeholders for sub-properties. [#2297](https://github.com/apache/incubator-dubbo/issues/2297)
|
||||
- Add ability to turn off SPI auto injection, special support for generic Object type injection. [#2681](https://github.com/apache/incubator-dubbo/pull/2681)
|
||||
|
||||
|
||||
Bugfixes:
|
||||
|
||||
- @Service(register=false) is not work. [#2063](https://github.com/apache/dubbo/issues/2063)
|
||||
- Our customized serialization id exceeds the maximum limit, now it cannot work on 2.6.2 anymore. [#1903](https://github.com/apache/dubbo/issues/1903)
|
||||
- Consumer throws RpcException after RegistryDirectory notify in high QPS. [#2016](https://github.com/apache/dubbo/issues/2016)
|
||||
- Annotation @Reference can't support to export a service with a sync one and an async one . [#2194](https://github.com/apache/dubbo/issues/2194)
|
||||
- `org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor#generateReferenceBeanCacheKey` has a bug. [#2522](https://github.com/apache/dubbo/issues/2522)
|
||||
- 2.6.x Spring Event & Bugfix. [#2256](https://github.com/apache/dubbo/issues/2256)
|
||||
- Fix incorrect descriptions for dubbo-serialization module. [#2665](https://github.com/apache/dubbo/issues/2665)
|
||||
- A empty directory dubbo-config/dubbo-config-spring/src/test/resources/work after package source tgz. [#2560](https://github.com/apache/dubbo/issues/2560)
|
||||
- Fixed 2.6.x branch a minor issue with doConnect not using getConnectTimeout() in NettyClient. (*No issue*). [#2622](https://github.com/apache/dubbo/pull/2622)
|
||||
- Bean name of @service annotated class does not resolve placeholder. [#1755](https://github.com/apache/dubbo/issues/1755)
|
||||
- @Service(register=false) is not work. [#2063](https://github.com/apache/incubator-dubbo/issues/2063)
|
||||
- Our customized serialization id exceeds the maximum limit, now it cannot work on 2.6.2 anymore. [#1903](https://github.com/apache/incubator-dubbo/issues/1903)
|
||||
- Consumer throws RpcException after RegistryDirectory notify in high QPS. [#2016](https://github.com/apache/incubator-dubbo/issues/2016)
|
||||
- Annotation @Reference can't support to export a service with a sync one and an async one . [#2194](https://github.com/apache/incubator-dubbo/issues/2194)
|
||||
- `org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor#generateReferenceBeanCacheKey` has a bug. [#2522](https://github.com/apache/incubator-dubbo/issues/2522)
|
||||
- 2.6.x Spring Event & Bugfix. [#2256](https://github.com/apache/incubator-dubbo/issues/2256)
|
||||
- Fix incorrect descriptions for dubbo-serialization module. [#2665](https://github.com/apache/incubator-dubbo/issues/2665)
|
||||
- A empty directory dubbo-config/dubbo-config-spring/src/test/resources/work after package source tgz. [#2560](https://github.com/apache/incubator-dubbo/issues/2560)
|
||||
- Fixed 2.6.x branch a minor issue with doConnect not using getConnectTimeout() in NettyClient. (*No issue*). [#2622](https://github.com/apache/incubator-dubbo/pull/2622)
|
||||
- Bean name of @service annotated class does not resolve placeholder. [#1755](https://github.com/apache/incubator-dubbo/issues/1755)
|
||||
|
||||
|
||||
|
||||
Issues and Pull Requests, check [milestone-2.6.5](https://github.com/apache/dubbo/milestone/21).
|
||||
Issues and Pull Requests, check [milestone-2.6.5](https://github.com/apache/incubator-dubbo/milestone/21).
|
||||
|
||||
## 2.6.4
|
||||
|
||||
Enhancements / Features
|
||||
|
||||
- Support access Redis with password, [#2146](https://github.com/apache/dubbo/pull/2146)
|
||||
- Support char array for GenericService, [#2137](https://github.com/apache/dubbo/pull/2137)
|
||||
- Direct return when the server goes down abnormally, [#2451](https://github.com/apache/dubbo/pull/2451)
|
||||
- Add log for trouble-shooting when qos start failed, [#2455](https://github.com/apache/dubbo/pull/2455)
|
||||
- PojoUtil support subclasses of java.util.Date, [#2502](https://github.com/apache/dubbo/pull/2502)
|
||||
- Add ip and application name for MonitorService, [#2166](https://github.com/apache/dubbo/pull/2166)
|
||||
- New ASCII logo, [#2402](https://github.com/apache/dubbo/pull/2402)
|
||||
- Support access Redis with password, [#2146](https://github.com/apache/incubator-dubbo/pull/2146)
|
||||
- Support char array for GenericService, [#2137](https://github.com/apache/incubator-dubbo/pull/2137)
|
||||
- Direct return when the server goes down abnormally, [#2451](https://github.com/apache/incubator-dubbo/pull/2451)
|
||||
- Add log for trouble-shooting when qos start failed, [#2455](https://github.com/apache/incubator-dubbo/pull/2455)
|
||||
- PojoUtil support subclasses of java.util.Date, [#2502](https://github.com/apache/incubator-dubbo/pull/2502)
|
||||
- Add ip and application name for MonitorService, [#2166](https://github.com/apache/incubator-dubbo/pull/2166)
|
||||
- New ASCII logo, [#2402](https://github.com/apache/incubator-dubbo/pull/2402)
|
||||
|
||||
Bugfixes
|
||||
|
||||
- Change consumer retries default value from 0 to 2, [#2303](https://github.com/apache/dubbo/pull/2303)
|
||||
- Fix the problem that attachment is lost when retry, [#2024](https://github.com/apache/dubbo/pull/2024)
|
||||
- Fix NPE when telnet get a null parameter, [#2453](https://github.com/apache/dubbo/pull/2453)
|
||||
- Change consumer retries default value from 0 to 2, [#2303](https://github.com/apache/incubator-dubbo/pull/2303)
|
||||
- Fix the problem that attachment is lost when retry, [#2024](https://github.com/apache/incubator-dubbo/pull/2024)
|
||||
- Fix NPE when telnet get a null parameter, [#2453](https://github.com/apache/incubator-dubbo/pull/2453)
|
||||
|
||||
UT stability
|
||||
|
||||
- Improve the stability by changing different port, setting timeout to 3000ms, [#2501](https://github.com/apache/dubbo/pull/2501)
|
||||
- Improve the stability by changing different port, setting timeout to 3000ms, [#2501](https://github.com/apache/incubator-dubbo/pull/2501)
|
||||
|
||||
Issues and Pull Requests, check [milestone-2.6.4](https://github.com/apache/dubbo/milestone/19).
|
||||
Issues and Pull Requests, check [milestone-2.6.4](https://github.com/apache/incubator-dubbo/milestone/19).
|
||||
|
||||
## 2.6.3
|
||||
|
||||
|
|
@ -511,3 +117,28 @@ Performance Tuning
|
|||
- Introduce embedded Threadlocal to replace the JDK implementation, #1745
|
||||
|
||||
Hessian-lite
|
||||
|
||||
- Hessian deserialization optimization, #1705
|
||||
- Support Locale type, #1761
|
||||
|
||||
Compatibilities
|
||||
This release is compatible with other versions since 2.5.3, and you can upgrade smoothly.
|
||||
- The RPC protocol version has been upgraded from 2.0.1 to 2.0.2, to support attachments delivery in #889,
|
||||
generally, the protocol version is used internally, so it should have no side effects on users.
|
||||
|
||||
Issues and Pull Requests, check [milestone-2.6.3](https://github.com/apache/incubator-dubbo/milestone/17).
|
||||
|
||||
|
||||
## 2.6.2
|
||||
|
||||
1. Hessian-lite serialization: revert locale serialization for compatibility, #1413
|
||||
2. Asset transfer to ASF, including pom, license, DISCLAIMER and so on, #1491
|
||||
3. Introduce of new dispatcher policy: EagerThreadpool, #1568
|
||||
4. Separate monitor data with group and version, #1407
|
||||
5. Spring Boot Enhancenment, #1611
|
||||
6. Graceful shutdown enhancement
|
||||
- Remove exporter destroy logic in AnnotationBean.
|
||||
- Waiting for registry notification on consumer side by checking channel state.
|
||||
7. Simplify consumer/provider side check in RpcContext, #1444.
|
||||
|
||||
Issues and Pull Requests, check [milestone-2.6.2](https://github.com/apache/incubator-dubbo/milestone/15).
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
|||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at dev@dubbo.apache.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at private@dubbo.apache.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,76 +1,25 @@
|
|||
|
||||
## Contributing to Dubbo
|
||||
Dubbo is released under the non-restrictive Apache 2.0 licenses and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. Contributions of all form to this repository is acceptable, as long as it follows the prescribed community guidelines enumerated below.
|
||||
|
||||
## Contributing to dubbo
|
||||
Dubbo is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.
|
||||
### Sign the Contributor License Agreement
|
||||
Before we accept a non-trivial patch or pull request (PRs), we will need you to sign the Contributor License Agreement. Signing the contributors' agreement does not grant anyone commits rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors may get invited to join the core team that will grant them privileges to merge existing PRs.
|
||||
|
||||
### Contact
|
||||
|
||||
#### Mailing list
|
||||
|
||||
The mailing list is the recommended way of pursuing a discussion on almost anything related to Dubbo. Please refer to this [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide) for detailed documentation on how to subscribe.
|
||||
|
||||
- [dev@dubbo.apache.org](mailto:dev-subscribe@dubbo.apache.org): the developer mailing list where you can ask questions about an issue you may have encountered while working with Dubbo.
|
||||
- [commits@dubbo.apache.org](mailto:commits-subscribe@dubbo.apache.org): the commit updates will get broadcasted on this mailing list. You can subscribe to it, should you be interested in following Dubbo's development.
|
||||
- [notifications@dubbo.apache.org](mailto:notifications-subscribe@dubbo.apache.org): all the Github [issue](https://github.com/apache/dubbo/issues) updates and [pull request](https://github.com/apache/dubbo/pulls) updates will be sent to this mailing list.
|
||||
|
||||
### Reporting issue
|
||||
|
||||
Please follow the [template](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues.
|
||||
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
|
||||
### Code Conventions
|
||||
Our code style is almost in line with the standard java conventions (Popular IDE's default setting satisfy this), with the following additional restricts:
|
||||
* If there are more than 120 characters in the current line, begin a new line.
|
||||
Our code style is almost in line with the standard java conventions(Popular IDE's default setting satisfy this), only changed the following two restricts:
|
||||
1. Classes under 'com.alibaba.*' and 'com.taobao.*' package are grouped separately, and put on top of all other 'imports'.
|
||||
2. If there are more than 120 characters in current line, start a new line.
|
||||
|
||||
* Make sure all new .java files to have a simple Javadoc class comment with at least a @date tag identifying birth, and preferably at least a paragraph on the intended purpose of the class.
|
||||
We provide a template file [dubbo_codestyle_for_idea.xml](https://github.com/alibaba/dubbo/tree/master/codestyle/dubbo_codestyle_for_idea.xml) for IntelliJ idea, you can import it to you IDE. If you use Eclipse you can config manually by referencing the same file.
|
||||
|
||||
* Make sure all new .java files to have a simple Javadoc class comment with at least a @date tag identifying birth, and preferably at least a paragraph on what the class is for.
|
||||
|
||||
* Add the ASF license header comment to all new .java files (copy from existing files in the project)
|
||||
|
||||
* Make sure no @author tag gets appended to the file you contribute to as the @author tag is incompatible with Apache. Rest assured, other ways, including CVS, will ensure transparency, fairness in recording your contributions.
|
||||
* Make sure no @author tag added to the file you contribute since @author tag is not used at Apache, other ways such as cvs will record all your contributions fairly.
|
||||
|
||||
* Add some Javadocs and, if you change the namespace, some XSD doc elements.
|
||||
|
||||
* Sufficient unit-tests should accompany new feature development or non-trivial bug fixes.
|
||||
* A few unit tests should be added for a new feature or an important bugfix.
|
||||
|
||||
* If no-one else is using your branch, please rebase it against the current master (or another target branch in the main project).
|
||||
|
||||
* When writing a commit message, please follow the following conventions: should your commit address an open issue, please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
|
||||
|
||||
### Contribution flow
|
||||
|
||||
A rough outline of an ideal contributors' workflow is as follows:
|
||||
|
||||
* Fork the current repository
|
||||
* Create a topic branch from where to base the contribution. Mostly, it's the master branch.
|
||||
* Make commits of logical units.
|
||||
* Make sure the commit messages are in the proper format (see below).
|
||||
* Push changes in a topic branch to your forked repository.
|
||||
* Follow the checklist in the [pull request template](https://github.com/apache/dubbo/blob/master/PULL_REQUEST_TEMPLATE.md)
|
||||
* Before sending out the pull request, please sync your forked repository with the remote repository to ensure that your PR is elegant, concise. Reference the guide below:
|
||||
```
|
||||
git remote add upstream git@github.com:apache/dubbo.git
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
git checkout -b your_awesome_patch
|
||||
... add some work
|
||||
git push origin your_awesome_patch
|
||||
```
|
||||
* Submit a pull request to apache/dubbo and wait for the reply.
|
||||
|
||||
Thanks for contributing!
|
||||
|
||||
### Code style
|
||||
|
||||
We provide a template file [dubbo_codestyle_for_idea.xml](https://github.com/apache/dubbo/tree/master/codestyle/dubbo_codestyle_for_idea.xml) for IntelliJ idea that you can import it to your workplace.
|
||||
If you use Eclipse, you can use the IntelliJ Idea template for manually configuring your file.
|
||||
|
||||
**NOTICE**
|
||||
|
||||
It's critical to set the dubbo_codestyle_for_idea.xml to avoid the failure of your Travis CI builds. Steps to configure the code styles are as follows:
|
||||
|
||||
1. Enter `Editor > Code Style`
|
||||
2. To manage a code style scheme, in the Code Style page, select the desired scheme from the drop-down list, and click on .
|
||||
From the drop-down list, select `Import Scheme`, then choose the option `IntelliJ IDEA code style XML` to import the scheme.
|
||||
3. In the Scheme field, type the name of the new scheme and press ⏎ to save the changes.
|
||||
* If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
|
||||
|
||||
* When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes #XXX at the end of the commit message (where XXX is the issue number).
|
||||
|
|
|
|||
|
|
@ -1,138 +0,0 @@
|
|||
import groovy.json.JsonSlurper
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'ubuntu'
|
||||
}
|
||||
}
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(daysToKeepStr: '14', artifactNumToKeepStr: '10'))
|
||||
}
|
||||
|
||||
environment {
|
||||
JAVA_HOME = "${tool 'JDK 1.8 (latest)'}"
|
||||
}
|
||||
|
||||
tools {
|
||||
maven 'Maven 3 (latest)'
|
||||
jdk 'JDK 1.8 (latest)'
|
||||
}
|
||||
|
||||
triggers {
|
||||
cron '''TZ=Asia/Shanghai
|
||||
H 2,14 * * *'''
|
||||
pollSCM '''TZ=Asia/Shanghai
|
||||
H H/2 * * *'''
|
||||
}
|
||||
|
||||
|
||||
stages {
|
||||
stage('Clone') {
|
||||
steps {
|
||||
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', noTags: true, reference: '', shallow: true]], gitTool: 'Default', submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/apache/dubbo.git']]])
|
||||
}
|
||||
}
|
||||
|
||||
stage('Duplicate deploy check') {
|
||||
steps {
|
||||
script {
|
||||
def deployedCommitId = sh(returnStdout: true, script: "curl --silent https://builds.apache.org/job/Apache%20Dubbo/job/${env.JOB_BASE_NAME}/lastSuccessfulBuild/artifact/DEPLOY_COMMIT_ID || true").trim()
|
||||
env.DEPLOYED_COMMIT_ID = deployedCommitId
|
||||
def commitId = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
|
||||
env.COMMIT_ID = commitId
|
||||
|
||||
if (commitId == deployedCommitId) {
|
||||
env.STATUS_CHECK = "false"
|
||||
println "Latest deployed commit id is $deployedCommitId, Skip deployment this time"
|
||||
} else {
|
||||
env.STATUS_CHECK = "true"
|
||||
println "Current commit id hasn't been deployed, continue"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Commit status check') {
|
||||
when {
|
||||
expression {
|
||||
return env.STATUS_CHECK == "true";
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def commitId = env.COMMIT_ID
|
||||
println "Current commit id: $commitId"
|
||||
|
||||
def commitStatusJson = sh(script: "curl --silent https://api.github.com/repos/apache/dubbo/commits/$commitId/status", returnStdout: true).trim()
|
||||
println "Commit status: \r\n$commitStatusJson"
|
||||
|
||||
def jsonSlurper = new JsonSlurper()
|
||||
def jsonObject = jsonSlurper.parseText(commitStatusJson)
|
||||
|
||||
def status = jsonObject.state
|
||||
|
||||
println "Current commit status is $status"
|
||||
|
||||
if (status == "success") {
|
||||
env.STATUS_CHECK = "true"
|
||||
println "Continue to deploy snapshot"
|
||||
} else {
|
||||
env.STATUS_CHECK = "false"
|
||||
println "Current commit status not allow to deploy snapshot"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Snapshot version check') {
|
||||
when {
|
||||
expression {
|
||||
return env.STATUS_CHECK == "true";
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'env'
|
||||
sh 'java -version'
|
||||
sh './mvnw clean install -pl "dubbo-dependencies-bom" && ./mvnw clean install -DskipTests=true && ./mvnw clean validate -Psnapshot-ci-deploy -pl "dubbo-all"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy snapshot') {
|
||||
when {
|
||||
expression {
|
||||
return env.STATUS_CHECK == "true";
|
||||
}
|
||||
}
|
||||
steps {
|
||||
timeout(40) {
|
||||
sh './mvnw --version'
|
||||
sh './mvnw clean package deploy -pl dubbo-dependencies-bom && ./mvnw clean source:jar javadoc:jar package deploy -DskipTests=true'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Save deployed commit id') {
|
||||
steps {
|
||||
script {
|
||||
if (env.STATUS_CHECK != "true") {
|
||||
println "Not pass status check"
|
||||
env.COMMIT_ID = env.DEPLOYED_COMMIT_ID
|
||||
}
|
||||
}
|
||||
writeFile file: 'DEPLOY_COMMIT_ID', text: "${env.COMMIT_ID}"
|
||||
archiveArtifacts 'DEPLOY_COMMIT_ID'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
failure {
|
||||
mail bcc: '', body: '''Project: ${env.JOB_NAME}
|
||||
Build Number: ${env.BUILD_NUMBER}
|
||||
URL: ${env.BUILD_URL}''', cc: '', from: '', replyTo: '', subject: 'Apache Dubbo snapshot deployment fail', to: 'dev@dubbo.apache.org'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
pipeline {
|
||||
agent {
|
||||
label 'ubuntu'
|
||||
}
|
||||
|
||||
tools {
|
||||
maven 'maven_3_latest'
|
||||
jdk 'jdk_11_latest'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Code Quality') {
|
||||
steps {
|
||||
echo 'Checking Code Quality on SonarCloud'
|
||||
script {
|
||||
// Main parameters
|
||||
def sonarcloudParams=""
|
||||
if ( env.BRANCH_NAME.startsWith("PR-") ) {
|
||||
// this is a pull request
|
||||
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_TOKEN')]) {
|
||||
sh './mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID} -Dsonar.login=${SONAR_TOKEN}'
|
||||
}
|
||||
} else {
|
||||
// this is just a branch
|
||||
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONAR_TOKEN')]) {
|
||||
sh './mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean verify sonar:sonar -Dmaven.test.skip=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_dubbo -Dsonar.coverage.jacoco.xmlReportPaths=dubbo-test/dubbo-dependencies-all/target/site/jacoco-aggregate/jacoco.xml -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
82
LICENSE
82
LICENSE
|
|
@ -208,82 +208,20 @@ Apache Dubbo includes a number of submodules with separate copyright notices
|
|||
and license terms. Your use of these submodules is subject to the terms and
|
||||
conditions of the following licenses.
|
||||
|
||||
For the package org.apache.dubbo.common.threadlocal and org.apache.dubbo.common.timer:
|
||||
For the com.alibaba.dubbo.common.concurrent package:
|
||||
|
||||
This product bundles and repackages the following code in Google Guava 16.0.1, which is available under a
|
||||
"Apache License 2.0" license. For details, see https://github.com/google/guava/blob/v16.0.1/COPYING.
|
||||
|
||||
* com.google.common.util.concurrent.ExecutionList
|
||||
* com.google.common.util.concurrent.ListenableFuture
|
||||
* com.google.common.util.concurrent.ListenableFutureTask
|
||||
|
||||
For the package com.alibaba.dubbo.common.threadlocal:
|
||||
|
||||
This product contains a modified portion of 'Netty', an event-driven asynchronous network application framework also
|
||||
under a "Apache License 2.0" license, see https://github.com/netty/netty/blob/4.1/LICENSE.txt:
|
||||
|
||||
* io.netty.util.concurrent.FastThreadLocal
|
||||
* io.netty.util.internal.InternalThreadLocalMap
|
||||
* io.netty.util.Timer
|
||||
* io.netty.util.TimerTask
|
||||
* io.netty.util.Timeout
|
||||
* io.netty.util.HashedWheelTimer
|
||||
|
||||
For the org.apache.dubbo.common.utils.CIDRUtils :
|
||||
|
||||
This product contains a modified portion of 'edazdarevic.commons.net.CIDRUtils' published at
|
||||
https://github.com/edazdarevic/CIDRUtils. The project is licensed under a MIT License:
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2013 Edin Dazdarevic (edin.dazdarevic@gmail.com)
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
|
||||
For the file org.apache.dubbo.common.utils.Utf8Utils.java:
|
||||
|
||||
This product contains a portion of the Protocol Buffers project, which is published at
|
||||
https://developers.google.com/protocol-buffers/ and is licensed under the following License:
|
||||
|
||||
Copyright 2008 Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Code generated by the Protocol Buffer compiler is owned by the owner
|
||||
of the input file used when generating it. This code is not
|
||||
standalone and requires a support library to be linked with it. This
|
||||
support library is itself covered by the above license.
|
||||
|
||||
For the ca.proto in dubbo-registry-xds:
|
||||
|
||||
This product contains a modified portion of 'Istio', an open platform to connect, manage, and secure microservices also
|
||||
under a "Apache License 2.0" license, see https://github.com/istio/api/blob/master/LICENSE:
|
||||
|
||||
* security/v1alpha1/ca.proto
|
||||
|
|
|
|||
32
NOTICE
32
NOTICE
|
|
@ -1,18 +1,14 @@
|
|||
Apache Dubbo
|
||||
Copyright 2018-2024 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
This product contains code form the Netty Project:
|
||||
|
||||
The Netty Project
|
||||
=================
|
||||
Please visit the Netty web site for more information:
|
||||
* http://netty.io/
|
||||
|
||||
Copyright 2014 The Netty Project
|
||||
|
||||
This product contains code form the t-digest Project:
|
||||
The code for the t-digest was originally authored by Ted Dunning
|
||||
Adrien Grand contributed the heart of the AVLTreeDigest (https://github.com/jpountz)
|
||||
Apache Dubbo
|
||||
Copyright 2018-2021 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
||||
This product contains code form the Netty Project:
|
||||
|
||||
The Netty Project
|
||||
=================
|
||||
Please visit the Netty web site for more information:
|
||||
* http://netty.io/
|
||||
|
||||
Copyright 2014 The Netty Project
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
## What is the purpose of the change
|
||||
|
||||
XXXXX
|
||||
|
||||
## Brief changelog
|
||||
|
||||
XXXXX
|
||||
|
||||
## Verifying this change
|
||||
|
||||
XXXXX
|
||||
|
||||
Follow this checklist to help us incorporate your contribution quickly and easily:
|
||||
|
||||
- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/incubator-dubbo/issues) filed 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 integration-test in [test module](https://github.com/alibaba/dubbo/tree/master/dubbo-test).
|
||||
- [ ] Run `mvn clean install -DskipTests` & `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](https://github.com/apache/incubator-dubbo/wiki/Software-donation-guide).
|
||||
293
README.md
293
README.md
|
|
@ -1,272 +1,27 @@
|
|||
# Apache Dubbo Project
|
||||
|
||||
[](https://github.com/apache/dubbo/actions/workflows/build-and-test-pr.yml)
|
||||
[](https://codecov.io/gh/apache/dubbo)
|
||||

|
||||

|
||||
[](http://isitmaintained.com/project/apache/dubbo "Average time to resolve an issue")
|
||||
[](http://isitmaintained.com/project/apache/dubbo "Percentage of issues still open")
|
||||
[](https://travis-ci.org/apache/dubbo)
|
||||
[](https://codecov.io/gh/apache/dubbo)
|
||||
[](https://gitter.im/alibaba/dubbo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||

|
||||

|
||||
|
||||
Apache Dubbo is a high-performance, java based RPC framework open-sourced by Alibaba. Please visit [dubbo official site ](http://dubbo.incubator.apache.org) for quick start and documentations, as well as [Wiki](https://github.com/apache/incubator-dubbo/wiki) for news, FAQ, and release notes.
|
||||
|
||||
We are now collecting dubbo user info in order to help us to improve dubbo better, pls. kindly help us by providing yours on [issue#1012: Wanted: who's using dubbo](https://github.com/apache/incubator-dubbo/issues/1012), thanks :)
|
||||
|
||||
## Links
|
||||
|
||||
* [Side projects](https://github.com/apache/incubator-dubbo)
|
||||
* [Dubbo Spring Boot](https://github.com/apache/incubator-dubbo-spring-boot-project) - Spring Boot Project for Dubbo.
|
||||
* [Dubbo ops](https://github.com/apache/incubator-dubbo-ops) - The reference implementation for dubbo ops(dubbo-admin,dubbo-monitor-simple,dubbo-registry-simple,etc.).
|
||||
* [Dubbo website](https://github.com/apache/incubator-dubbo-website) - Apache Dubbo documents
|
||||
* [Dubbo rpc-jsonrpc](https://github.com/apache/incubator-dubbo-rpc-jsonrpc) - The Json rpc module of Apache Dubbo project
|
||||
* [Dubbo feature-test](https://github.com/apache/incubator-dubbo-feature-test) - Apache Dubbo feature test
|
||||
* [Dubbo docs](https://github.com/apache/incubator-dubbo-docs) - Apache Dubbo documentation
|
||||
* [Developer Mailing list](https://github.com/apache/incubator-dubbo/issues/1393) - Any questions or suggestions? [Subscribe](https://github.com/apache/incubator-dubbo/issues/1393) to (dev@dubbo.incubator.apache.org) to discuss with us.
|
||||
* [Gitter channel](https://gitter.im/alibaba/dubbo) - Online chat room with Dubbo developers.
|
||||
* [Dubbo user manual(English)](http://dubbo.apache.org/books/dubbo-user-book-en/) or [Dubbo用户手册(中文)](http://dubbo.apache.org/books/dubbo-user-book/) - Describe how to use Dubbo and all features of Dubbo concretely.
|
||||
* [Dubbo developer guide(English)](http://dubbo.apache.org/books/dubbo-dev-book-en/) or [Dubbo开发手册(中文)](http://dubbo.apache.org/books/dubbo-dev-book/) - Detailly introduce the design principal, extension mechanisms, code conventions, version control and building project, etc.
|
||||
* [Dubbo admin manual(English)](http://dubbo.apache.org/books/dubbo-admin-book-en/) or [Dubbo管理手册(中文)](http://dubbo.apache.org/books/dubbo-admin-book/) - Describe how to use Dubbo registry and admin-console.
|
||||
|
||||
Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit the [official site](http://dubbo.apache.org) for the quick start guide and documentation, as well as the [wiki](https://github.com/apache/dubbo/wiki) for news, FAQ, and release notes.
|
||||
|
||||
We are now collecting Dubbo user info to help us to improve Dubbo further. Kindly support us by providing your usage information on [Wanted: who's using dubbo](https://github.com/apache/dubbo/discussions/13842), thanks :)
|
||||
|
||||
## Architecture
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
* Transparent interface based RPC
|
||||
* Intelligent load balancing
|
||||
* Automatic service registration and discovery
|
||||
* High extensibility
|
||||
* Runtime traffic routing
|
||||
* Visualized service governance
|
||||
|
||||
## Getting started
|
||||
|
||||
The following code snippet comes from [Dubbo Samples](https://github.com/apache/dubbo-samples.git). You may clone the sample project and step into the `dubbo-samples-api` subdirectory before proceeding.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/apache/dubbo-samples.git
|
||||
cd dubbo-samples/1-basic/dubbo-samples-api
|
||||
```
|
||||
|
||||
There's a [README](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee6e575005b32f195c442c35a2/1-basic/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. We recommend referencing the samples in that directory by following the below-mentioned instructions:
|
||||
|
||||
### Maven dependency
|
||||
|
||||
```xml
|
||||
<properties>
|
||||
<dubbo.version>3.2.13-SNAPSHOT</dubbo.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>${dubbo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-dependencies-zookeeper</artifactId>
|
||||
<version>${dubbo.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
### Define service interfaces
|
||||
|
||||
```java
|
||||
package org.apache.dubbo.samples.api;
|
||||
|
||||
public interface GreetingsService {
|
||||
String sayHi(String name);
|
||||
}
|
||||
```
|
||||
|
||||
*See [api/GreetingsService.java](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee6e575005b32f195c442c35a2/1-basic/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/api/GreetingsService.java) on GitHub.*
|
||||
|
||||
### Implement service interface for the provider
|
||||
|
||||
```java
|
||||
package org.apache.dubbo.samples.provider;
|
||||
|
||||
import org.apache.dubbo.samples.api.GreetingsService;
|
||||
|
||||
public class GreetingsServiceImpl implements GreetingsService {
|
||||
@Override
|
||||
public String sayHi(String name) {
|
||||
return "hi, " + name;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*See [provider/GreetingsServiceImpl.java](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee6e575005b32f195c442c35a2/1-basic/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/provider/GreetingsServiceImpl.java) on GitHub.*
|
||||
|
||||
### Start service provider
|
||||
|
||||
```java
|
||||
package org.apache.dubbo.samples.provider;
|
||||
|
||||
|
||||
import org.apache.dubbo.config.ApplicationConfig;
|
||||
import org.apache.dubbo.config.RegistryConfig;
|
||||
import org.apache.dubbo.config.ServiceConfig;
|
||||
import org.apache.dubbo.samples.api.GreetingsService;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
public class Application {
|
||||
private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ServiceConfig<GreetingsService> service = new ServiceConfig<>();
|
||||
service.setApplication(new ApplicationConfig("first-dubbo-provider"));
|
||||
service.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
|
||||
service.setInterface(GreetingsService.class);
|
||||
service.setRef(new GreetingsServiceImpl());
|
||||
service.export();
|
||||
|
||||
System.out.println("dubbo service started");
|
||||
new CountDownLatch(1).await();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*See [provider/Application.java](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee6e575005b32f195c442c35a2/1-basic/dubbo-samples-spring-xml/src/main/java/org/apache/dubbo/samples/provider/Application.java) on GitHub.*
|
||||
|
||||
### Build and run the provider
|
||||
|
||||
```bash
|
||||
mvn clean package
|
||||
mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java
|
||||
```
|
||||
|
||||
### Call remote service in the consumer
|
||||
|
||||
```java
|
||||
package org.apache.dubbo.samples.client;
|
||||
|
||||
|
||||
import org.apache.dubbo.config.ApplicationConfig;
|
||||
import org.apache.dubbo.config.ReferenceConfig;
|
||||
import org.apache.dubbo.config.RegistryConfig;
|
||||
import org.apache.dubbo.samples.api.GreetingsService;
|
||||
|
||||
public class Application {
|
||||
private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");
|
||||
|
||||
public static void main(String[] args) {
|
||||
ReferenceConfig<GreetingsService> reference = new ReferenceConfig<>();
|
||||
reference.setApplication(new ApplicationConfig("first-dubbo-consumer"));
|
||||
reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
|
||||
reference.setInterface(GreetingsService.class);
|
||||
GreetingsService service = reference.get();
|
||||
String message = service.sayHi("dubbo");
|
||||
System.out.println(message);
|
||||
}
|
||||
}
|
||||
```
|
||||
*See [client/Application.java](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee6e575005b32f195c442c35a2/1-basic/dubbo-samples-api/src/main/java/org/apache/dubbo/samples/client/Application.java) on GitHub.*
|
||||
|
||||
### Build and run the consumer
|
||||
|
||||
```bash
|
||||
mvn clean package
|
||||
mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.client.Application exec:java
|
||||
```
|
||||
|
||||
The consumer will print out `hi, dubbo` on the screen.
|
||||
|
||||
|
||||
### Next steps
|
||||
|
||||
* [Your first Dubbo application](https://dubbo.apache.org/en/blog/2018/08/07/dubbo-101/) - A 101 tutorial to reveal more details, with the same code above.
|
||||
* [Dubbo user manual](https://dubbo.apache.org/en/overview/what/) - How to use Dubbo and all its features.
|
||||
* [Dubbo developer guide](https://dubbo.apache.org/en/docs3-v2/java-sdk/) - How to involve in Dubbo development.
|
||||
* [Dubbo admin manual](https://dubbo.apache.org/en/docs/v2.7/admin/ops/) - How to admin and manage Dubbo services.
|
||||
|
||||
## Building
|
||||
|
||||
If you want to try out the cutting-edge features, you can build with the following commands. (Java 1.8 is needed to build the master branch)
|
||||
|
||||
```
|
||||
mvn clean install
|
||||
```
|
||||
|
||||
## Recommended Test Environment
|
||||
To avoid intermittent test failures (i.e., flaky tests), it is recommended to have a machine or virtual machine with the following specifications:
|
||||
|
||||
* Minimum of 2CPUs.
|
||||
* Minimum of 2Gb of RAM.
|
||||
|
||||
### How does the Dubbo Community collaborate?
|
||||
|
||||
The Dubbo Community primarily communicates on GitHub through issues, discussions, and pull requests.
|
||||
|
||||
- Issues: We use issues to track bugs and tasks. Any **work-related** item is associated with an issue.
|
||||
- Discussions: We use discussions for questions, early proposals, and announcements. Any **idea-related** item is associated with a discussion.
|
||||
- Pull Requests: We use pull requests to merge a set of changes from contributors into Dubbo.
|
||||
|
||||
We have also implemented [a project board](https://github.com/orgs/apache/projects/337) to monitor all the items.
|
||||
|
||||
Any essential changes should be discussed on the mailing list before they happen.
|
||||
|
||||
### Seeking for help
|
||||
|
||||
If you have questions such as:
|
||||
|
||||
- What is Dubbo?
|
||||
- How do I use Dubbo?
|
||||
- Why did an unexpected result occur?
|
||||
|
||||
Please start a discussion at https://github.com/apache/dubbo/discussions.
|
||||
|
||||
However, if you encounter the following situations:
|
||||
|
||||
- You're certain there's a bug that Dubbo needs to fix,
|
||||
- You believe a feature could be enhanced,
|
||||
- You have a detailed proposal for improving Dubbo,
|
||||
|
||||
Please open an issue at https://github.com/apache/dubbo/issues.
|
||||
|
||||
To ask effective questions, we recommend reading **[How To Ask Questions The Smart Way](https://github.com/selfteaching/How-To-Ask-Questions-The-Smart-Way/blob/master/How-To-Ask-Questions-The-Smart-Way.md)** first.
|
||||
|
||||
### Contribution
|
||||
|
||||
- Browse the "help wanted" tasks in the [Dubbo project board](https://github.com/orgs/apache/projects/337).
|
||||
- Participate in discussions on the mailing list. See the subscription [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide).
|
||||
- Respond to queries in the [discussions](https://github.com/apache/dubbo/issues).
|
||||
- Resolve bugs reported in [issues](https://github.com/apache/dubbo/issues) and send us a pull request.
|
||||
- Review existing [pull requests](https://github.com/apache/dubbo/pulls).
|
||||
- Enhance the [website](https://github.com/apache/dubbo-website). We typically need:
|
||||
- Blog posts
|
||||
- Translations for documentation
|
||||
- Use cases showcasing Dubbo integration in enterprise systems.
|
||||
- Improve the [dubbo-admin](https://github.com/apache/dubbo-admin).
|
||||
- Contribute to the projects listed in the [ecosystem](https://github.com/apache/?q=dubbo&type=all&language=&sort=).
|
||||
- Any other forms of contribution not listed above are also welcome.
|
||||
- If you're interested in contributing, please send an email to [dev@dubbo.apache.org](mailto:dev@dubbo.apache.org) to let us know!
|
||||
|
||||
For further details, please refer our [guide](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md) about how to contribute Dubbo.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Please follow the [template](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues.
|
||||
|
||||
## Reporting a security vulnerability
|
||||
|
||||
Please report security vulnerabilities to [us](mailto:security@dubbo.apache.org) privately.
|
||||
|
||||
## Contact
|
||||
|
||||
* Mailing list:
|
||||
* dev list: for dev/user discussion. [subscribe](mailto:dev-subscribe@dubbo.apache.org), [unsubscribe](mailto:dev-unsubscribe@dubbo.apache.org), [archive](https://lists.apache.org/list.html?dev@dubbo.apache.org), [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)
|
||||
|
||||
* Bugs: [Issues](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md)
|
||||
* Gitter: [Gitter channel](https://gitter.im/alibaba/dubbo)
|
||||
* Twitter: [@ApacheDubbo](https://twitter.com/ApacheDubbo)
|
||||
|
||||
## Dubbo ecosystem
|
||||
|
||||
* [Dubbo Ecosystem Entry](https://github.com/apache?utf8=%E2%9C%93&q=dubbo&type=&language=) - A GitHub group `dubbo` to gather all Dubbo relevant projects not appropriate in [apache](https://github.com/apache) group yet
|
||||
* [Dubbo Website](https://github.com/apache/dubbo-website) - Apache Dubbo official website
|
||||
* [Dubbo Samples](https://github.com/apache/dubbo-samples) - samples for Apache Dubbo
|
||||
* [Dubbo Admin](https://github.com/apache/dubbo-admin) - The reference implementation for Dubbo admin
|
||||
* [Dubbo Awesome](https://github.com/apache/dubbo-awesome) - Dubbo's slides and video links in Meetup
|
||||
|
||||
#### Language
|
||||
|
||||
* [Go](https://github.com/apache/dubbo-go) (recommended)
|
||||
* [Rust](https://github.com/apache/dubbo-rust)
|
||||
* [Node.js](https://github.com/apache/dubbo-js)
|
||||
* [Python](https://github.com/dubbo/py-client-for-apache-dubbo)
|
||||
* [PHP](https://github.com/apache/dubbo-php-framework)
|
||||
* [Erlang](https://github.com/apache/dubbo-erlang)
|
||||
|
||||
## License
|
||||
|
||||
Apache Dubbo software is licensed under the Apache License Version 2.0. See the [LICENSE](https://github.com/apache/dubbo/blob/master/LICENSE) file for details.
|
||||
|
|
|
|||
34
SECURITY.md
34
SECURITY.md
|
|
@ -1,34 +0,0 @@
|
|||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Below is a table that shows versions that we accept security fixes.
|
||||
|
||||
| Version | Supported |
|
||||
|---------| ------------------ |
|
||||
| 3.3.x | :white_check_mark: |
|
||||
| 3.2.x | :white_check_mark: |
|
||||
| 3.1.x | :white_check_mark: |
|
||||
| 3.0.x | :x: |
|
||||
| 2.7.x | :x: |
|
||||
| 2.6.x | :x: |
|
||||
| 2.5.x | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
The Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its software projects. Apache Dubbo is highly sensitive and forthcoming to issues pertaining to its features and functionality.
|
||||
|
||||
If you have apprehensions regarding Dubbo's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with the Apache Dubbo Security Team by dropping a mail at security@dubbo.apache.org. In the email, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The Dubbo community will get back to you after assessing and analysing the findings.
|
||||
|
||||
PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain.
|
||||
|
||||
## Vulnerability Handling
|
||||
|
||||
An overview of the vulnerability handling process is:
|
||||
|
||||
* The reporter reports the vulnerability privately to Apache.
|
||||
* The appropriate project's security team works privately with the reporter to resolve the vulnerability.
|
||||
* A new release of the Apache product concerned is made that includes the fix.
|
||||
* The vulnerability is publicly announced.
|
||||
|
||||
A more detailed description of the process can be found [here](https://www.apache.org/security/committers.html).
|
||||
|
|
@ -0,0 +1,595 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-parent</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>dubbo-all</name>
|
||||
<description>The all in one project of dubbo</description>
|
||||
<properties>
|
||||
<skip_maven_deploy>false</skip_maven_deploy>
|
||||
<hessian_lite_version>3.2.4</hessian_lite_version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-cluster</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-cache</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-validation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty4</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-mina</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-grizzly</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-p2p</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-dubbo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-injvm</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rmi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-hessian</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-webservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-thrift</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-memcached</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-multicast</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-zookeeper</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-log4j</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-logback</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-qos</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fst</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-jdk</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-kryo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>hessian-lite</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Transitive dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Temporarily add this part to exclude transitive dependency -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit_version}</version>
|
||||
<scope>test</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib-nodep</artifactId>
|
||||
<version>${cglib_version}</version>
|
||||
<scope>test</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>1.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<promoteTransitiveDependencies>false</promoteTransitiveDependencies>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>com.alibaba:hessian-lite</include>
|
||||
<include>com.alibaba:dubbo-common</include>
|
||||
<include>com.alibaba:dubbo-remoting-api</include>
|
||||
<include>com.alibaba:dubbo-remoting-netty</include>
|
||||
<include>com.alibaba:dubbo-remoting-netty4</include>
|
||||
<include>com.alibaba:dubbo-remoting-mina</include>
|
||||
<include>com.alibaba:dubbo-remoting-grizzly</include>
|
||||
<include>com.alibaba:dubbo-remoting-p2p</include>
|
||||
<include>com.alibaba:dubbo-remoting-http</include>
|
||||
<include>com.alibaba:dubbo-remoting-zookeeper</include>
|
||||
<include>com.alibaba:dubbo-rpc-api</include>
|
||||
<include>com.alibaba:dubbo-rpc-dubbo</include>
|
||||
<include>com.alibaba:dubbo-rpc-injvm</include>
|
||||
<include>com.alibaba:dubbo-rpc-rmi</include>
|
||||
<include>com.alibaba:dubbo-rpc-hessian</include>
|
||||
<include>com.alibaba:dubbo-rpc-http</include>
|
||||
<include>com.alibaba:dubbo-rpc-webservice</include>
|
||||
<include>com.alibaba:dubbo-rpc-thrift</include>
|
||||
<include>com.alibaba:dubbo-rpc-memcached</include>
|
||||
<include>com.alibaba:dubbo-rpc-redis</include>
|
||||
<include>com.alibaba:dubbo-rpc-rest</include>
|
||||
<include>com.alibaba:dubbo-filter-validation</include>
|
||||
<include>com.alibaba:dubbo-filter-cache</include>
|
||||
<include>com.alibaba:dubbo-cluster</include>
|
||||
<include>com.alibaba:dubbo-registry-api</include>
|
||||
<include>com.alibaba:dubbo-registry-default</include>
|
||||
<include>com.alibaba:dubbo-registry-multicast</include>
|
||||
<include>com.alibaba:dubbo-registry-zookeeper</include>
|
||||
<include>com.alibaba:dubbo-registry-redis</include>
|
||||
<include>com.alibaba:dubbo-monitor-api</include>
|
||||
<include>com.alibaba:dubbo-monitor-default</include>
|
||||
<include>com.alibaba:dubbo-config-api</include>
|
||||
<include>com.alibaba:dubbo-config-spring</include>
|
||||
<include>com.alibaba:dubbo-container-api</include>
|
||||
<include>com.alibaba:dubbo-container-spring</include>
|
||||
<include>com.alibaba:dubbo-container-log4j</include>
|
||||
<include>com.alibaba:dubbo-container-logback</include>
|
||||
<include>com.alibaba:dubbo-qos</include>
|
||||
<include>com.alibaba:dubbo-serialization-api</include>
|
||||
<include>com.alibaba:dubbo-serialization-fastjson</include>
|
||||
<include>com.alibaba:dubbo-serialization-hessian2</include>
|
||||
<include>com.alibaba:dubbo-serialization-fst</include>
|
||||
<include>com.alibaba:dubbo-serialization-kryo</include>
|
||||
<include>com.alibaba:dubbo-serialization-jdk</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>
|
||||
META-INF/dubbo/internal/com.alibaba.dubbo.common.extension.ExtensionFactory
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.serialize.Serialization
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.status.StatusChecker
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.threadpool.ThreadPool
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.Dispatcher</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.Codec2</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.Transporter</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.exchange.Exchanger
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.http.HttpBinder
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.p2p.Networker
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.remoting.telnet.TelnetHandler
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>
|
||||
META-INF/dubbo/internal/com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.Protocol</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.Filter</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.InvokerListener</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.ExporterListener</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.ProxyFactory</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.Cluster</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.LoadBalance
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.Merger</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.RouterFactory
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>
|
||||
META-INF/dubbo/internal/com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.container.Container</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.monitor.MonitorFactory
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.registry.RegistryFactory
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.validation.Validation</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.cache.CacheFactory</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.store.DataStore
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.common.logger.LoggerAdapter
|
||||
</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/dubbo/internal/com.alibaba.dubbo.qos.command.BaseCommand
|
||||
</resource>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>com.alibaba:dubbo</artifact>
|
||||
<excludes>
|
||||
<!-- These two line is optional, it can remove some warn log -->
|
||||
<exclude>com/**</exclude>
|
||||
<exclude>org/**</exclude>
|
||||
<!-- This one is required -->
|
||||
<exclude>META-INF/dubbo/**</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven_javadoc_version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadoc</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<doclint>none</doclint>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<includeDependencySources>true</includeDependencySources>
|
||||
<dependencySourceIncludes>
|
||||
<dependencySourceInclude>com.alibaba:dubbo-*</dependencySourceInclude>
|
||||
<dependencySourceExclude>com.alibaba:hessian-*</dependencySourceExclude>
|
||||
</dependencySourceIncludes>
|
||||
<show>public</show>
|
||||
<charset>UTF-8</charset>
|
||||
<encoding>UTF-8</encoding>
|
||||
<docencoding>UTF-8</docencoding>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/7/docs/api</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,327 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
<hessian_lite_version>3.2.4</hessian_lite_version>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>7</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-bom</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>dubbo-bom</name>
|
||||
<description>Dubbo dependencies BOM</description>
|
||||
<url>https://github.com/apache/incubator-dubbo</url>
|
||||
<inceptionYear>2011</inceptionYear>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/apache/incubator-dubbo</url>
|
||||
<connection>scm:git:https://github.com/apache/incubator-dubbo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/apache/incubator-dubbo.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>Development List</name>
|
||||
<subscribe>dev-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>dev-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>dev@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Commits List</name>
|
||||
<subscribe>commits-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>commits-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>commits@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Issues List</name>
|
||||
<subscribe>issues-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>issues-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>issues@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>dubbo.io</id>
|
||||
<name>The Dubbo Project Contributors</name>
|
||||
<email>dev-subscribe@dubbo.apache.org</email>
|
||||
<url>http://dubbo.apache.org/</url>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>The Apache Software Foundation</name>
|
||||
<url>http://www.apache.org/</url>
|
||||
</organization>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issues</system>
|
||||
<url>https://github.com/apache/incubator-dubbo/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-cluster</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-cache</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-validation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty4</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-mina</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-grizzly</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-p2p</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-dubbo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-injvm</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rmi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-hessian</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-webservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-thrift</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-memcached</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-multicast</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-zookeeper</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-log4j</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-logback</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-qos</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fst</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-jdk</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-kryo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
34
codecov.yml
34
codecov.yml
|
|
@ -1,34 +0,0 @@
|
|||
# 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.
|
||||
#
|
||||
codecov:
|
||||
require_ci_to_pass: false
|
||||
notify:
|
||||
wait_for_ci: false
|
||||
coverage:
|
||||
status:
|
||||
# pull-requests only
|
||||
patch:
|
||||
default:
|
||||
threshold: 0.1%
|
||||
ignore:
|
||||
- "**/dubbo-demo/**"
|
||||
- "**/dubbo-compiler/**"
|
||||
- "**/dubbo-test/**"
|
||||
- "**/dubbo-compatible/**"
|
||||
- "**/dubbo-native/**"
|
||||
- "**/dubbo-native-plugin/**"
|
||||
- "**/dubbo-common/src/main/java/org/apache/dubbo/common/json/*.java" # internal JSON impl is deprecate, ignore test coverage for them
|
||||
- "**/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/AnnotationBean.java" # Deprecated
|
||||
|
|
@ -4,7 +4,5 @@
|
|||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
<suppressions>
|
||||
<suppress files="[\\/]src[\\/]main[\\/]java[\\/]com[\\/]alibaba[\\/]com[\\/]caucho[\\/]hessian" checks=".*"/>
|
||||
<suppress files="[\\/]build[\\/]generated[\\/]source[\\/]proto" checks=".*"/>
|
||||
<suppress files="[\\/]target[\\/]generated-sources[\\/]protobuf" checks=".*"/>
|
||||
<suppress files="Yylex\.java" checks="AvoidEscapedUnicodeCharacters"/>
|
||||
</suppressions>
|
||||
</suppressions>
|
||||
|
|
@ -7,18 +7,9 @@
|
|||
<property name="charset" value="UTF-8"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
|
||||
<module name="Header">
|
||||
<property name="headerFile" value="/checkstyle-header.txt"/>
|
||||
<property name="fileExtensions" value="java"/>
|
||||
</module>
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="fileExtensions" value="java,xml"/>
|
||||
</module>
|
||||
|
||||
<!-- TreeWalker Checks -->
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressWarningsHolder"/>
|
||||
<module name="SuppressWarningsHolder" />
|
||||
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="AvoidEscapedUnicodeCharacters">
|
||||
|
|
@ -29,14 +20,5 @@
|
|||
<module name="NoLineWrap"/>
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="UnusedImports"/>
|
||||
<module name="RedundantImport"/>
|
||||
|
||||
<module name="EqualsHashCode"/>
|
||||
|
||||
<!--<module name="CustomImportOrder">-->
|
||||
<!--<property name="specialImportsRegExp" value="org.apache.dubbo.*"/>-->
|
||||
<!--<property name="sortImportsInGroupAlphabetically" value="false"/>-->
|
||||
<!--<property name="customImportOrderRules" value="SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/>-->
|
||||
<!--</module>-->
|
||||
</module>
|
||||
</module>
|
||||
</module>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<module name="NewlineAtEndOfFile">
|
||||
<property name="lineSeparator" value="lf" />
|
||||
</module>
|
||||
</module>
|
||||
|
|
@ -3,7 +3,9 @@
|
|||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99"/>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="org.apache.dubbo" withSubpackages="true" static="false"/>
|
||||
<package name="com.alibaba" withSubpackages="true" static="false"/>
|
||||
<emptyLine/>
|
||||
<package name="com.taobao" withSubpackages="true" static="false"/>
|
||||
<emptyLine/>
|
||||
<package name="" withSubpackages="true" static="false"/>
|
||||
<emptyLine/>
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 430 B |
|
|
@ -0,0 +1,429 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>7</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-dependencies-bom</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>dubbo-dependencies-bom</name>
|
||||
<description>Dubbo dependencies BOM</description>
|
||||
<url>https://github.com/apache/incubator-dubbo</url>
|
||||
<inceptionYear>2011</inceptionYear>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/apache/incubator-dubbo</url>
|
||||
<connection>scm:git:https://github.com/apache/incubator-dubbo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/apache/incubator-dubbo.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>Development List</name>
|
||||
<subscribe>dev-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>dev-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>dev@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Commits List</name>
|
||||
<subscribe>commits-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>commits-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>commits@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
<mailingList>
|
||||
<name>Issues List</name>
|
||||
<subscribe>issues-subscribe@dubbo.apache.org</subscribe>
|
||||
<unsubscribe>issues-unsubscribe@dubbo.apache.org</unsubscribe>
|
||||
<post>issues@dubbo.apache.org</post>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>dubbo.io</id>
|
||||
<name>The Dubbo Project Contributors</name>
|
||||
<email>dev-subscribe@dubbo.apache.org</email>
|
||||
<url>http://dubbo.apache.org/</url>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<organization>
|
||||
<name>The Apache Software Foundation</name>
|
||||
<url>http://www.apache.org/</url>
|
||||
</organization>
|
||||
|
||||
<issueManagement>
|
||||
<system>Github Issues</system>
|
||||
<url>https://github.com/apache/incubator-dubbo/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<properties>
|
||||
<!-- Common libs -->
|
||||
<spring_version>4.3.16.RELEASE</spring_version>
|
||||
<javassist_version>3.20.0-GA</javassist_version>
|
||||
<netty_version>3.2.5.Final</netty_version>
|
||||
<netty4_version>4.1.25.Final</netty4_version>
|
||||
<mina_version>1.1.7</mina_version>
|
||||
<grizzly_version>2.1.4</grizzly_version>
|
||||
<httpclient_version>4.5.3</httpclient_version>
|
||||
<fastjson_version>1.2.70</fastjson_version>
|
||||
<zookeeper_version>3.4.9</zookeeper_version>
|
||||
<zkclient_version>0.2</zkclient_version>
|
||||
<curator_version>2.12.0</curator_version>
|
||||
<jedis_version>2.9.0</jedis_version>
|
||||
<xmemcached_version>1.3.6</xmemcached_version>
|
||||
<cxf_version>3.1.15</cxf_version>
|
||||
<thrift_version>0.8.0</thrift_version>
|
||||
<hessian_version>4.0.51</hessian_version>
|
||||
<servlet_version>3.1.0</servlet_version>
|
||||
<jetty_version>6.1.26</jetty_version>
|
||||
<validation_version>1.1.0.Final</validation_version>
|
||||
<hibernate_validator_version>5.4.1.Final</hibernate_validator_version>
|
||||
<jel_version>3.0.1-b08</jel_version>
|
||||
<jcache_version>1.0.0</jcache_version>
|
||||
<kryo_version>4.0.1</kryo_version>
|
||||
<kryo_serializers_version>0.42</kryo_serializers_version>
|
||||
<fst_version>2.48-jdk-6</fst_version>
|
||||
|
||||
<rs_api_version>2.0</rs_api_version>
|
||||
<resteasy_version>3.0.19.Final</resteasy_version>
|
||||
<tomcat_embed_version>8.5.31</tomcat_embed_version>
|
||||
|
||||
<!-- Log libs -->
|
||||
<slf4j_version>1.7.25</slf4j_version>
|
||||
<jcl_version>1.2</jcl_version>
|
||||
<log4j_version>1.2.16</log4j_version>
|
||||
<logback_version>1.2.2</logback_version>
|
||||
<commons_lang3_version>3.4</commons_lang3_version>
|
||||
<embedded_redis_version>0.6</embedded_redis_version>
|
||||
|
||||
<jaxb_version>2.2.7</jaxb_version>
|
||||
<activation_version>1.2.0</activation_version>
|
||||
<hessian_lite_version>3.2.12</hessian_lite_version>
|
||||
<alibaba_spring_context_support_version>1.0.2</alibaba_spring_context_support_version>
|
||||
<yaml_version>1.17</yaml_version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- Common libs -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-framework-bom</artifactId>
|
||||
<version>${spring_version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>${javassist_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.netty</groupId>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>${netty_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>${netty4_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.mina</groupId>
|
||||
<artifactId>mina-core</artifactId>
|
||||
<version>${mina_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.grizzly</groupId>
|
||||
<artifactId>grizzly-core</artifactId>
|
||||
<version>${grizzly_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>${httpclient_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
<version>${zookeeper_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.101tec</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>${zkclient_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-framework</artifactId>
|
||||
<version>${curator_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>${jedis_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.xmemcached</groupId>
|
||||
<artifactId>xmemcached</artifactId>
|
||||
<version>${xmemcached_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-simple</artifactId>
|
||||
<version>${cxf_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http</artifactId>
|
||||
<version>${cxf_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.thrift</groupId>
|
||||
<artifactId>libthrift</artifactId>
|
||||
<version>${thrift_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.caucho</groupId>
|
||||
<artifactId>hessian</artifactId>
|
||||
<version>${hessian_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${servlet_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>${validation_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<version>${hibernate_validator_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
<artifactId>javax.el</artifactId>
|
||||
<version>${jel_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.cache</groupId>
|
||||
<artifactId>cache-api</artifactId>
|
||||
<version>${jcache_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.esotericsoftware</groupId>
|
||||
<artifactId>kryo</artifactId>
|
||||
<version>${kryo_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.javakaffee</groupId>
|
||||
<artifactId>kryo-serializers</artifactId>
|
||||
<version>${kryo_serializers_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
<version>${fst_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>javax.ws.rs-api</artifactId>
|
||||
<version>${rs_api_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jaxrs</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-client</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-netty4</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jdk-http</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jaxb-provider</artifactId>
|
||||
<version>${resteasy_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>${tomcat_embed_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-logging-juli</artifactId>
|
||||
<version>${tomcat_embed_version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Log libs -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>${slf4j_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>${jcl_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons_lang3_version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- for dubbo-rpc-webservice -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${jaxb_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>${jaxb_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>${jaxb_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>javax.activation-api</artifactId>
|
||||
<version>${activation_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>javax.activation</artifactId>
|
||||
<version>${activation_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>hessian-lite</artifactId>
|
||||
<version>${hessian_lite_version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Alibaba extensions -->
|
||||
|
||||
<!-- YAML -->
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>${yaml_version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test lib -->
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-test</artifactId>
|
||||
<version>${curator_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.kstyrc</groupId>
|
||||
<artifactId>embedded-redis</artifactId>
|
||||
<version>${embedded_redis_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,302 @@
|
|||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-parent</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>dubbo-distribution</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>dubbo-distribution</name>
|
||||
<description>The binary distribution module for dubbo temporarily</description>
|
||||
<properties>
|
||||
<skip_maven_deploy>true</skip_maven_deploy>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-cluster</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-config-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-cache</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-filter-validation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-netty4</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-mina</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-grizzly</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-p2p</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-remoting-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-dubbo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-injvm</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rmi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-hessian</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-webservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-thrift</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-memcached</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-rest</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-multicast</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-zookeeper</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-registry-redis</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-monitor-default</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-log4j</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-container-logback</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-qos</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-fst</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-jdk</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-serialization-kryo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>hessian-lite</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<finalName>apache-dubbo-${project.version}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bin-release</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/assembly/bin-release.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>source-release</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/assembly/source-release.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
@ -16,38 +16,35 @@
|
|||
-->
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
<id>bin</id>
|
||||
<id>bin-release</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>true</includeBaseDirectory>
|
||||
<baseDirectory>${project.build.finalName}-bin</baseDirectory>
|
||||
<baseDirectory>${project.build.finalName}-bin-release</baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>../../</directory>
|
||||
<directory>../</directory>
|
||||
<includes>
|
||||
<include>DISCLAIMER</include>
|
||||
<include>NOTICE</include>
|
||||
<include>LICENSE</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../../dubbo-demo</directory>
|
||||
<includes>
|
||||
<include>README.md</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>false</unpack>
|
||||
<outputDirectory>/dubbo-demo</outputDirectory>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<scope>runtime</scope>
|
||||
<includes>
|
||||
<include>org.apache.dubbo:dubbo-demo-api*</include>
|
||||
<include>com.alibaba:*</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>com.alibaba:fastjson</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
|
|
@ -16,16 +16,16 @@
|
|||
-->
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
<id>src</id>
|
||||
<id>source-release</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>true</includeBaseDirectory>
|
||||
<baseDirectory>${project.build.finalName}-src</baseDirectory>
|
||||
<baseDirectory>${project.build.finalName}-source-release</baseDirectory>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>../../</directory>
|
||||
<directory>../</directory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
|
|
@ -46,11 +46,10 @@
|
|||
<exclude>**/*.log</exclude>
|
||||
<exclude>release.properties</exclude>
|
||||
<exclude>**/*.xml.*</exclude>
|
||||
<exclude>**/*.patch</exclude>
|
||||
<exclude>**/.mvn/**</exclude>
|
||||
<exclude>**/*.jar</exclude>
|
||||
<exclude>**/mvnw*</exclude>
|
||||
<exclude>**/.flattened-pom.xml</exclude>
|
||||
<exclude>**/invalid_data.ser</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-build-tools</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||
<spotless.action>check</spotless.action>
|
||||
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
|
||||
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java11+</id>
|
||||
<activation>
|
||||
<jdk>[11,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<!--- newer versions of plugins requires JDK 11 -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>${spotless-maven-plugin.version}</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<palantirJavaFormat>
|
||||
<version>${palantirJavaFormat.version}</version>
|
||||
</palantirJavaFormat>
|
||||
<removeUnusedImports />
|
||||
<importOrder>
|
||||
<file>dubbo-importorder.txt</file>
|
||||
</importOrder>
|
||||
<licenseHeader>
|
||||
<file>checkstyle-header.txt</file>
|
||||
</licenseHeader>
|
||||
</java>
|
||||
<pom>
|
||||
<sortPom>
|
||||
<expandEmptyElements>false</expandEmptyElements>
|
||||
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
|
||||
</sortPom>
|
||||
</pom>
|
||||
<upToDateChecking>
|
||||
<enabled>true</enabled>
|
||||
</upToDateChecking>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-shared-resources</artifactId>
|
||||
<version>${dubbo-shared-resources.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>${spotless.action}</goal>
|
||||
</goals>
|
||||
<phase>process-sources</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
|
|
@ -16,103 +15,24 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>dubbo-cluster</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>The cluster module of dubbo project</description>
|
||||
<properties>
|
||||
<skip_maven_deploy>false</skip_maven_deploy>
|
||||
<nashorn-core.version>15.4</nashorn-core.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-api</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-rpc-injvm</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.curator</groupId>
|
||||
<artifactId>curator-framework</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.zookeeper</groupId>
|
||||
<artifactId>zookeeper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-hessian2</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-serialization-fastjson2</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-test-check</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-registry</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-metrics-default</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-tracing-integration-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!--
|
||||
https://github.com/openjdk/nashorn
|
||||
Nashorn used to be part of the JDK until Java 14.
|
||||
This project provides a standalone version of Nashorn suitable for use with Java 11 and later.
|
||||
-->
|
||||
<profile>
|
||||
<id>nashorn-jdk11</id>
|
||||
<activation>
|
||||
<jdk>[11,)</jdk>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-parent</artifactId>
|
||||
<version>2.6.13-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>dubbo-cluster</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>The cluster module of dubbo project</description>
|
||||
<properties>
|
||||
<skip_maven_deploy>false</skip_maven_deploy>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.nashorn</groupId>
|
||||
<artifactId>nashorn-core</artifactId>
|
||||
<version>${nashorn-core.version}</version>
|
||||
<scope>test</scope>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo-rpc-api</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.extension.Adaptive;
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.support.FailoverCluster;
|
||||
|
||||
/**
|
||||
* Cluster. (SPI, Singleton, ThreadSafe)
|
||||
* <p>
|
||||
* <a href="http://en.wikipedia.org/wiki/Computer_cluster">Cluster</a>
|
||||
* <a href="http://en.wikipedia.org/wiki/Fault-tolerant_system">Fault-Tolerant</a>
|
||||
*
|
||||
*/
|
||||
@SPI(FailoverCluster.NAME)
|
||||
public interface Cluster {
|
||||
|
||||
/**
|
||||
* Merge the directory invokers to a virtual invoker.
|
||||
*
|
||||
* @param <T>
|
||||
* @param directory
|
||||
* @return cluster invoker
|
||||
* @throws RpcException
|
||||
*/
|
||||
@Adaptive
|
||||
<T> Invoker<T> join(Directory<T> directory) throws RpcException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
/**
|
||||
* Configurator. (SPI, Prototype, ThreadSafe)
|
||||
*
|
||||
*/
|
||||
public interface Configurator extends Comparable<Configurator> {
|
||||
|
||||
/**
|
||||
* get the configurator url.
|
||||
*
|
||||
* @return configurator url.
|
||||
*/
|
||||
URL getUrl();
|
||||
|
||||
/**
|
||||
* Configure the provider url.
|
||||
* O
|
||||
*
|
||||
* @param url - old rovider url.
|
||||
* @return new provider url.
|
||||
*/
|
||||
URL configure(URL url);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.extension.Adaptive;
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
|
||||
/**
|
||||
* ConfiguratorFactory. (SPI, Singleton, ThreadSafe)
|
||||
*
|
||||
*/
|
||||
@SPI
|
||||
public interface ConfiguratorFactory {
|
||||
|
||||
/**
|
||||
* get the configurator instance.
|
||||
*
|
||||
* @param url - configurator url.
|
||||
* @return configurator instance.
|
||||
*/
|
||||
@Adaptive("protocol")
|
||||
Configurator getConfigurator(URL url);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.Node;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Directory. (SPI, Prototype, ThreadSafe)
|
||||
* <p>
|
||||
* <a href="http://en.wikipedia.org/wiki/Directory_service">Directory Service</a>
|
||||
*
|
||||
* @see com.alibaba.dubbo.rpc.cluster.Cluster#join(Directory)
|
||||
*/
|
||||
public interface Directory<T> extends Node {
|
||||
|
||||
/**
|
||||
* get service type.
|
||||
*
|
||||
* @return service type.
|
||||
*/
|
||||
Class<T> getInterface();
|
||||
|
||||
/**
|
||||
* list invokers.
|
||||
*
|
||||
* @return invokers
|
||||
*/
|
||||
List<Invoker<T>> list(Invocation invocation) throws RpcException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.extension.Adaptive;
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.loadbalance.RandomLoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* LoadBalance. (SPI, Singleton, ThreadSafe)
|
||||
* <p>
|
||||
* <a href="http://en.wikipedia.org/wiki/Load_balancing_(computing)">Load-Balancing</a>
|
||||
*
|
||||
* @see com.alibaba.dubbo.rpc.cluster.Cluster#join(Directory)
|
||||
*/
|
||||
@SPI(RandomLoadBalance.NAME)
|
||||
public interface LoadBalance {
|
||||
|
||||
/**
|
||||
* select one invoker in list.
|
||||
*
|
||||
* @param invokers invokers.
|
||||
* @param url refer url
|
||||
* @param invocation invocation.
|
||||
* @return selected invoker.
|
||||
*/
|
||||
@Adaptive("loadbalance")
|
||||
<T> Invoker<T> select(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
|
||||
@SPI
|
||||
public interface Merger<T> {
|
||||
|
||||
T merge(T... items);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Router. (SPI, Prototype, ThreadSafe)
|
||||
* <p>
|
||||
* <a href="http://en.wikipedia.org/wiki/Routing">Routing</a>
|
||||
*
|
||||
* @see com.alibaba.dubbo.rpc.cluster.Cluster#join(Directory)
|
||||
* @see com.alibaba.dubbo.rpc.cluster.Directory#list(Invocation)
|
||||
*/
|
||||
public interface Router extends Comparable<Router>{
|
||||
|
||||
/**
|
||||
* get the router url.
|
||||
*
|
||||
* @return url
|
||||
*/
|
||||
URL getUrl();
|
||||
|
||||
/**
|
||||
* route.
|
||||
*
|
||||
* @param invokers
|
||||
* @param url refer url
|
||||
* @param invocation
|
||||
* @return routed invokers
|
||||
* @throws RpcException
|
||||
*/
|
||||
<T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException;
|
||||
|
||||
/**
|
||||
* Router's priority, used to sort routers.
|
||||
*
|
||||
* @return router's priority
|
||||
*/
|
||||
int getPriority();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.extension.Adaptive;
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
|
||||
/**
|
||||
* RouterFactory. (SPI, Singleton, ThreadSafe)
|
||||
* <p>
|
||||
* <a href="http://en.wikipedia.org/wiki/Routing">Routing</a>
|
||||
*
|
||||
* @see Cluster#join(Directory)
|
||||
* @see Directory#list(com.alibaba.dubbo.rpc.Invocation)
|
||||
*/
|
||||
@SPI
|
||||
public interface RouterFactory {
|
||||
|
||||
/**
|
||||
* Create router.
|
||||
*
|
||||
* @param url
|
||||
* @return router
|
||||
*/
|
||||
@Adaptive("protocol")
|
||||
Router getRouter(URL url);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.extension.SPI;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SPI
|
||||
public interface RuleConverter {
|
||||
|
||||
List<URL> convert(URL subscribeUrl, Object source);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.configurator;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.utils.NetUtils;
|
||||
import com.alibaba.dubbo.rpc.cluster.Configurator;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* AbstractOverrideConfigurator
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractConfigurator implements Configurator {
|
||||
|
||||
private final URL configuratorUrl;
|
||||
|
||||
public AbstractConfigurator(URL url) {
|
||||
if (url == null) {
|
||||
throw new IllegalArgumentException("configurator url == null");
|
||||
}
|
||||
this.configuratorUrl = url;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(URL.encode("timeout=100"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return configuratorUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL configure(URL url) {
|
||||
if (configuratorUrl == null || configuratorUrl.getHost() == null
|
||||
|| url == null || url.getHost() == null) {
|
||||
return url;
|
||||
}
|
||||
// If override url has port, means it is a provider address. We want to control a specific provider with this override url, it may take effect on the specific provider instance or on consumers holding this provider instance.
|
||||
if (configuratorUrl.getPort() != 0) {
|
||||
if (url.getPort() == configuratorUrl.getPort()) {
|
||||
return configureIfMatch(url.getHost(), url);
|
||||
}
|
||||
} else {// override url don't have a port, means the ip override url specify is a consumer address or 0.0.0.0
|
||||
// 1.If it is a consumer ip address, the intention is to control a specific consumer instance, it must takes effect at the consumer side, any provider received this override url should ignore;
|
||||
// 2.If the ip is 0.0.0.0, this override url can be used on consumer, and also can be used on provider
|
||||
if (url.getParameter(Constants.SIDE_KEY, Constants.PROVIDER).equals(Constants.CONSUMER)) {
|
||||
return configureIfMatch(NetUtils.getLocalHost(), url);// NetUtils.getLocalHost is the ip address consumer registered to registry.
|
||||
} else if (url.getParameter(Constants.SIDE_KEY, Constants.CONSUMER).equals(Constants.PROVIDER)) {
|
||||
return configureIfMatch(Constants.ANYHOST_VALUE, url);// take effect on all providers, so address must be 0.0.0.0, otherwise it won't flow to this if branch
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private URL configureIfMatch(String host, URL url) {
|
||||
if (Constants.ANYHOST_VALUE.equals(configuratorUrl.getHost()) || host.equals(configuratorUrl.getHost())) {
|
||||
String configApplication = configuratorUrl.getParameter(Constants.APPLICATION_KEY,
|
||||
configuratorUrl.getUsername());
|
||||
String currentApplication = url.getParameter(Constants.APPLICATION_KEY, url.getUsername());
|
||||
if (configApplication == null || Constants.ANY_VALUE.equals(configApplication)
|
||||
|| configApplication.equals(currentApplication)) {
|
||||
Set<String> conditionKeys = new HashSet<String>();
|
||||
conditionKeys.add(Constants.CATEGORY_KEY);
|
||||
conditionKeys.add(Constants.CHECK_KEY);
|
||||
conditionKeys.add(Constants.DYNAMIC_KEY);
|
||||
conditionKeys.add(Constants.ENABLED_KEY);
|
||||
for (Map.Entry<String, String> entry : configuratorUrl.getParameters().entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
if (key.startsWith("~") || Constants.APPLICATION_KEY.equals(key) || Constants.SIDE_KEY.equals(key)) {
|
||||
conditionKeys.add(key);
|
||||
if (value != null && !Constants.ANY_VALUE.equals(value)
|
||||
&& !value.equals(url.getParameter(key.startsWith("~") ? key.substring(1) : key))) {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
return doConfigure(url, configuratorUrl.removeParameters(conditionKeys));
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort by host, priority
|
||||
* 1. the url with a specific host ip should have higher priority than 0.0.0.0
|
||||
* 2. if two url has the same host, compare by priority value;
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(Configurator o) {
|
||||
if (o == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ipCompare = getUrl().getHost().compareTo(o.getUrl().getHost());
|
||||
if (ipCompare == 0) {//host is the same, sort by priority
|
||||
int i = getUrl().getParameter(Constants.PRIORITY_KEY, 0),
|
||||
j = o.getUrl().getParameter(Constants.PRIORITY_KEY, 0);
|
||||
return i < j ? -1 : (i == j ? 0 : 1);
|
||||
} else {
|
||||
return ipCompare;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected abstract URL doConfigure(URL currentUrl, URL configUrl);
|
||||
|
||||
}
|
||||
|
|
@ -1,35 +1,37 @@
|
|||
/*
|
||||
* 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 org.apache.dubbo.rpc.cluster.configurator.absent;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.rpc.cluster.configurator.AbstractConfigurator;
|
||||
|
||||
/**
|
||||
* AbsentConfigurator
|
||||
*/
|
||||
public class AbsentConfigurator extends AbstractConfigurator {
|
||||
|
||||
public AbsentConfigurator(URL url) {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL doConfigure(URL currentUrl, URL configUrl) {
|
||||
return currentUrl.addParametersIfAbsent(configUrl.getParameters());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.configurator.absent;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.configurator.AbstractConfigurator;
|
||||
|
||||
/**
|
||||
* AbsentConfigurator
|
||||
*
|
||||
*/
|
||||
public class AbsentConfigurator extends AbstractConfigurator {
|
||||
|
||||
public AbsentConfigurator(URL url) {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL doConfigure(URL currentUrl, URL configUrl) {
|
||||
return currentUrl.addParametersIfAbsent(configUrl.getParameters());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,33 +1,34 @@
|
|||
/*
|
||||
* 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 org.apache.dubbo.rpc.cluster.configurator.absent;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.rpc.cluster.Configurator;
|
||||
import org.apache.dubbo.rpc.cluster.ConfiguratorFactory;
|
||||
|
||||
/**
|
||||
* AbsentConfiguratorFactory
|
||||
*
|
||||
*/
|
||||
public class AbsentConfiguratorFactory implements ConfiguratorFactory {
|
||||
|
||||
@Override
|
||||
public Configurator getConfigurator(URL url) {
|
||||
return new AbsentConfigurator(url);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.configurator.absent;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.Configurator;
|
||||
import com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory;
|
||||
|
||||
/**
|
||||
* AbsentConfiguratorFactory
|
||||
*
|
||||
*/
|
||||
public class AbsentConfiguratorFactory implements ConfiguratorFactory {
|
||||
|
||||
@Override
|
||||
public Configurator getConfigurator(URL url) {
|
||||
return new AbsentConfigurator(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.configurator.override;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.configurator.AbstractConfigurator;
|
||||
|
||||
/**
|
||||
* AbsentConfigurator
|
||||
*
|
||||
*/
|
||||
public class OverrideConfigurator extends AbstractConfigurator {
|
||||
|
||||
public OverrideConfigurator(URL url) {
|
||||
super(url);
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL doConfigure(URL currentUrl, URL configUrl) {
|
||||
return currentUrl.addParameters(configUrl.getParameters());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,33 +1,34 @@
|
|||
/*
|
||||
* 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 org.apache.dubbo.rpc.cluster.configurator.override;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.rpc.cluster.Configurator;
|
||||
import org.apache.dubbo.rpc.cluster.ConfiguratorFactory;
|
||||
|
||||
/**
|
||||
* OverrideConfiguratorFactory
|
||||
*
|
||||
*/
|
||||
public class OverrideConfiguratorFactory implements ConfiguratorFactory {
|
||||
|
||||
@Override
|
||||
public Configurator getConfigurator(URL url) {
|
||||
return new OverrideConfigurator(url);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.configurator.override;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.Configurator;
|
||||
import com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory;
|
||||
|
||||
/**
|
||||
* AbsentConfiguratorFactory
|
||||
*
|
||||
*/
|
||||
public class OverrideConfiguratorFactory implements ConfiguratorFactory {
|
||||
|
||||
@Override
|
||||
public Configurator getConfigurator(URL url) {
|
||||
return new OverrideConfigurator(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.directory;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.extension.ExtensionLoader;
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
import com.alibaba.dubbo.rpc.cluster.RouterFactory;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.MockInvokersSelector;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.tag.TagRouter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Abstract implementation of Directory: Invoker list returned from this Directory's list method have been filtered by Routers
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractDirectory<T> implements Directory<T> {
|
||||
|
||||
// logger
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractDirectory.class);
|
||||
|
||||
private final URL url;
|
||||
|
||||
private volatile boolean destroyed = false;
|
||||
|
||||
private volatile URL consumerUrl;
|
||||
|
||||
private volatile List<Router> routers;
|
||||
|
||||
public AbstractDirectory(URL url) {
|
||||
this(url, null);
|
||||
}
|
||||
|
||||
public AbstractDirectory(URL url, List<Router> routers) {
|
||||
this(url, url, routers);
|
||||
}
|
||||
|
||||
public AbstractDirectory(URL url, URL consumerUrl, List<Router> routers) {
|
||||
if (url == null)
|
||||
throw new IllegalArgumentException("url == null");
|
||||
this.url = url;
|
||||
this.consumerUrl = consumerUrl;
|
||||
setRouters(routers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Invoker<T>> list(Invocation invocation) throws RpcException {
|
||||
if (destroyed) {
|
||||
throw new RpcException("Directory already destroyed .url: " + getUrl());
|
||||
}
|
||||
List<Invoker<T>> invokers = doList(invocation);
|
||||
List<Router> localRouters = this.routers; // local reference
|
||||
if (localRouters != null && !localRouters.isEmpty()) {
|
||||
for (Router router : localRouters) {
|
||||
try {
|
||||
if (router.getUrl() == null || router.getUrl().getParameter(Constants.RUNTIME_KEY, false)) {
|
||||
invokers = router.route(invokers, getConsumerUrl(), invocation);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.error("Failed to execute router: " + getUrl() + ", cause: " + t.getMessage(), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
return invokers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public List<Router> getRouters() {
|
||||
return routers;
|
||||
}
|
||||
|
||||
protected void setRouters(List<Router> routers) {
|
||||
// copy list
|
||||
routers = routers == null ? new ArrayList<Router>() : new ArrayList<Router>(routers);
|
||||
// append url router
|
||||
String routerkey = url.getParameter(Constants.ROUTER_KEY);
|
||||
if (routerkey != null && routerkey.length() > 0) {
|
||||
RouterFactory routerFactory = ExtensionLoader.getExtensionLoader(RouterFactory.class).getExtension(routerkey);
|
||||
routers.add(routerFactory.getRouter(url));
|
||||
}
|
||||
// append mock invoker selector
|
||||
routers.add(new MockInvokersSelector());
|
||||
routers.add(new TagRouter());
|
||||
Collections.sort(routers);
|
||||
this.routers = routers;
|
||||
}
|
||||
|
||||
public URL getConsumerUrl() {
|
||||
return consumerUrl;
|
||||
}
|
||||
|
||||
public void setConsumerUrl(URL consumerUrl) {
|
||||
this.consumerUrl = consumerUrl;
|
||||
}
|
||||
|
||||
public boolean isDestroyed() {
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
destroyed = true;
|
||||
}
|
||||
|
||||
protected abstract List<Invoker<T>> doList(Invocation invocation) throws RpcException;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.directory;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* StaticDirectory
|
||||
*
|
||||
*/
|
||||
public class StaticDirectory<T> extends AbstractDirectory<T> {
|
||||
|
||||
private final List<Invoker<T>> invokers;
|
||||
|
||||
public StaticDirectory(List<Invoker<T>> invokers) {
|
||||
this(null, invokers, null);
|
||||
}
|
||||
|
||||
public StaticDirectory(List<Invoker<T>> invokers, List<Router> routers) {
|
||||
this(null, invokers, routers);
|
||||
}
|
||||
|
||||
public StaticDirectory(URL url, List<Invoker<T>> invokers) {
|
||||
this(url, invokers, null);
|
||||
}
|
||||
|
||||
public StaticDirectory(URL url, List<Invoker<T>> invokers, List<Router> routers) {
|
||||
super(url == null && invokers != null && !invokers.isEmpty() ? invokers.get(0).getUrl() : url, routers);
|
||||
if (invokers == null || invokers.isEmpty())
|
||||
throw new IllegalArgumentException("invokers == null");
|
||||
this.invokers = invokers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getInterface() {
|
||||
return invokers.get(0).getInterface();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
if (isDestroyed()) {
|
||||
return false;
|
||||
}
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.isAvailable()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
super.destroy();
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
invoker.destroy();
|
||||
}
|
||||
invokers.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Invoker<T>> doList(Invocation invocation) throws RpcException {
|
||||
|
||||
return invokers;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AbstractLoadBalance
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractLoadBalance implements LoadBalance {
|
||||
|
||||
static int calculateWarmupWeight(int uptime, int warmup, int weight) {
|
||||
int ww = (int) ((float) uptime / ((float) warmup / (float) weight));
|
||||
return ww < 1 ? 1 : (ww > weight ? weight : ww);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> select(List<Invoker<T>> invokers, URL url, Invocation invocation) {
|
||||
if (invokers == null || invokers.isEmpty())
|
||||
return null;
|
||||
if (invokers.size() == 1)
|
||||
return invokers.get(0);
|
||||
return doSelect(invokers, url, invocation);
|
||||
}
|
||||
|
||||
protected abstract <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation);
|
||||
|
||||
protected int getWeight(Invoker<?> invoker, Invocation invocation) {
|
||||
int weight = invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT);
|
||||
if (weight > 0) {
|
||||
long timestamp = invoker.getUrl().getParameter(Constants.REMOTE_TIMESTAMP_KEY, 0L);
|
||||
if (timestamp > 0L) {
|
||||
int uptime = (int) (System.currentTimeMillis() - timestamp);
|
||||
int warmup = invoker.getUrl().getParameter(Constants.WARMUP_KEY, Constants.DEFAULT_WARMUP);
|
||||
if (uptime > 0 && uptime < warmup) {
|
||||
weight = calculateWarmupWeight(uptime, warmup, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.support.RpcUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* ConsistentHashLoadBalance
|
||||
*
|
||||
*/
|
||||
public class ConsistentHashLoadBalance extends AbstractLoadBalance {
|
||||
|
||||
private final ConcurrentMap<String, ConsistentHashSelector<?>> selectors = new ConcurrentHashMap<String, ConsistentHashSelector<?>>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
|
||||
String methodName = RpcUtils.getMethodName(invocation);
|
||||
String key = invokers.get(0).getUrl().getServiceKey() + "." + methodName;
|
||||
int identityHashCode = System.identityHashCode(invokers);
|
||||
ConsistentHashSelector<T> selector = (ConsistentHashSelector<T>) selectors.get(key);
|
||||
if (selector == null || selector.identityHashCode != identityHashCode) {
|
||||
selectors.put(key, new ConsistentHashSelector<T>(invokers, methodName, identityHashCode));
|
||||
selector = (ConsistentHashSelector<T>) selectors.get(key);
|
||||
}
|
||||
return selector.select(invocation);
|
||||
}
|
||||
|
||||
private static final class ConsistentHashSelector<T> {
|
||||
|
||||
private final TreeMap<Long, Invoker<T>> virtualInvokers;
|
||||
|
||||
private final int replicaNumber;
|
||||
|
||||
private final int identityHashCode;
|
||||
|
||||
private final int[] argumentIndex;
|
||||
|
||||
ConsistentHashSelector(List<Invoker<T>> invokers, String methodName, int identityHashCode) {
|
||||
this.virtualInvokers = new TreeMap<Long, Invoker<T>>();
|
||||
this.identityHashCode = identityHashCode;
|
||||
URL url = invokers.get(0).getUrl();
|
||||
this.replicaNumber = url.getMethodParameter(methodName, "hash.nodes", 160);
|
||||
String[] index = Constants.COMMA_SPLIT_PATTERN.split(url.getMethodParameter(methodName, "hash.arguments", "0"));
|
||||
argumentIndex = new int[index.length];
|
||||
for (int i = 0; i < index.length; i++) {
|
||||
argumentIndex[i] = Integer.parseInt(index[i]);
|
||||
}
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
String address = invoker.getUrl().getAddress();
|
||||
for (int i = 0; i < replicaNumber / 4; i++) {
|
||||
byte[] digest = md5(address + i);
|
||||
for (int h = 0; h < 4; h++) {
|
||||
long m = hash(digest, h);
|
||||
virtualInvokers.put(m, invoker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Invoker<T> select(Invocation invocation) {
|
||||
String key = toKey(invocation.getArguments());
|
||||
byte[] digest = md5(key);
|
||||
return selectForKey(hash(digest, 0));
|
||||
}
|
||||
|
||||
private String toKey(Object[] args) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (int i : argumentIndex) {
|
||||
if (i >= 0 && i < args.length) {
|
||||
buf.append(args[i]);
|
||||
}
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
private Invoker<T> selectForKey(long hash) {
|
||||
Map.Entry<Long, Invoker<T>> entry = virtualInvokers.tailMap(hash, true).firstEntry();
|
||||
if (entry == null) {
|
||||
entry = virtualInvokers.firstEntry();
|
||||
}
|
||||
return entry.getValue();
|
||||
}
|
||||
|
||||
private long hash(byte[] digest, int number) {
|
||||
return (((long) (digest[3 + number * 4] & 0xFF) << 24)
|
||||
| ((long) (digest[2 + number * 4] & 0xFF) << 16)
|
||||
| ((long) (digest[1 + number * 4] & 0xFF) << 8)
|
||||
| (digest[number * 4] & 0xFF))
|
||||
& 0xFFFFFFFFL;
|
||||
}
|
||||
|
||||
private byte[] md5(String value) {
|
||||
MessageDigest md5;
|
||||
try {
|
||||
md5 = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new IllegalStateException(e.getMessage(), e);
|
||||
}
|
||||
md5.reset();
|
||||
byte[] bytes;
|
||||
try {
|
||||
bytes = value.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new IllegalStateException(e.getMessage(), e);
|
||||
}
|
||||
md5.update(bytes);
|
||||
return md5.digest();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcStatus;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* LeastActiveLoadBalance
|
||||
*
|
||||
*/
|
||||
public class LeastActiveLoadBalance extends AbstractLoadBalance {
|
||||
|
||||
public static final String NAME = "leastactive";
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
@Override
|
||||
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
|
||||
int length = invokers.size(); // Number of invokers
|
||||
int leastActive = -1; // The least active value of all invokers
|
||||
int leastCount = 0; // The number of invokers having the same least active value (leastActive)
|
||||
int[] leastIndexs = new int[length]; // The index of invokers having the same least active value (leastActive)
|
||||
int totalWeight = 0; // The sum of with warmup weights
|
||||
int firstWeight = 0; // Initial value, used for comparision
|
||||
boolean sameWeight = true; // Every invoker has the same weight value?
|
||||
for (int i = 0; i < length; i++) {
|
||||
Invoker<T> invoker = invokers.get(i);
|
||||
int active = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName()).getActive(); // Active number
|
||||
int afterWarmup = getWeight(invoker, invocation); // Weight
|
||||
if (leastActive == -1 || active < leastActive) { // Restart, when find a invoker having smaller least active value.
|
||||
leastActive = active; // Record the current least active value
|
||||
leastCount = 1; // Reset leastCount, count again based on current leastCount
|
||||
leastIndexs[0] = i; // Reset
|
||||
totalWeight = afterWarmup; // Reset
|
||||
firstWeight = afterWarmup; // Record the weight the first invoker
|
||||
sameWeight = true; // Reset, every invoker has the same weight value?
|
||||
} else if (active == leastActive) { // If current invoker's active value equals with leaseActive, then accumulating.
|
||||
leastIndexs[leastCount++] = i; // Record index number of this invoker
|
||||
totalWeight += afterWarmup; // Add this invoker's weight to totalWeight.
|
||||
// If every invoker has the same weight?
|
||||
if (sameWeight && i > 0
|
||||
&& afterWarmup != firstWeight) {
|
||||
sameWeight = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// assert(leastCount > 0)
|
||||
if (leastCount == 1) {
|
||||
// If we got exactly one invoker having the least active value, return this invoker directly.
|
||||
return invokers.get(leastIndexs[0]);
|
||||
}
|
||||
if (!sameWeight && totalWeight > 0) {
|
||||
// If (not every invoker has the same weight & at least one invoker's weight>0), select randomly based on totalWeight.
|
||||
int offsetWeight = random.nextInt(totalWeight) + 1;
|
||||
// Return a invoker based on the random value.
|
||||
for (int i = 0; i < leastCount; i++) {
|
||||
int leastIndex = leastIndexs[i];
|
||||
offsetWeight -= getWeight(invokers.get(leastIndex), invocation);
|
||||
if (offsetWeight <= 0)
|
||||
return invokers.get(leastIndex);
|
||||
}
|
||||
}
|
||||
// If all invokers have the same weight value or totalWeight=0, return evenly.
|
||||
return invokers.get(leastIndexs[random.nextInt(leastCount)]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* random load balance.
|
||||
*
|
||||
*/
|
||||
public class RandomLoadBalance extends AbstractLoadBalance {
|
||||
|
||||
public static final String NAME = "random";
|
||||
|
||||
private final Random random = new Random();
|
||||
|
||||
@Override
|
||||
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
|
||||
int length = invokers.size(); // Number of invokers
|
||||
int totalWeight = 0; // The sum of weights
|
||||
boolean sameWeight = true; // Every invoker has the same weight?
|
||||
for (int i = 0; i < length; i++) {
|
||||
int weight = getWeight(invokers.get(i), invocation);
|
||||
totalWeight += weight; // Sum
|
||||
if (sameWeight && i > 0
|
||||
&& weight != getWeight(invokers.get(i - 1), invocation)) {
|
||||
sameWeight = false;
|
||||
}
|
||||
}
|
||||
if (totalWeight > 0 && !sameWeight) {
|
||||
// If (not every invoker has the same weight & at least one invoker's weight>0), select randomly based on totalWeight.
|
||||
int offset = random.nextInt(totalWeight);
|
||||
// Return a invoker based on the random value.
|
||||
for (int i = 0; i < length; i++) {
|
||||
offset -= getWeight(invokers.get(i), invocation);
|
||||
if (offset < 0) {
|
||||
return invokers.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// If all invokers have the same weight value or totalWeight=0, return evenly.
|
||||
return invokers.get(random.nextInt(length));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
/**
|
||||
* Round robin load balance.
|
||||
*
|
||||
* Smoothly round robin's implementation @since 2.6.5
|
||||
*/
|
||||
public class RoundRobinLoadBalance extends AbstractLoadBalance {
|
||||
public static final String NAME = "roundrobin";
|
||||
|
||||
private static int RECYCLE_PERIOD = 60000;
|
||||
|
||||
protected static class WeightedRoundRobin {
|
||||
private int weight;
|
||||
private AtomicLong current = new AtomicLong(0);
|
||||
private long lastUpdate;
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
current.set(0);
|
||||
}
|
||||
public long increaseCurrent() {
|
||||
return current.addAndGet(weight);
|
||||
}
|
||||
public void sel(int total) {
|
||||
current.addAndGet(-1 * total);
|
||||
}
|
||||
public long getLastUpdate() {
|
||||
return lastUpdate;
|
||||
}
|
||||
public void setLastUpdate(long lastUpdate) {
|
||||
this.lastUpdate = lastUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
private ConcurrentMap<String, ConcurrentMap<String, WeightedRoundRobin>> methodWeightMap = new ConcurrentHashMap<String, ConcurrentMap<String, WeightedRoundRobin>>();
|
||||
private AtomicBoolean updateLock = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* get invoker addr list cached for specified invocation
|
||||
* <p>
|
||||
* <b>for unit test only</b>
|
||||
*
|
||||
* @param invokers
|
||||
* @param invocation
|
||||
* @return
|
||||
*/
|
||||
protected <T> Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation) {
|
||||
String key = invokers.get(0).getUrl().getServiceKey() + "." + invocation.getMethodName();
|
||||
Map<String, WeightedRoundRobin> map = methodWeightMap.get(key);
|
||||
if (map != null) {
|
||||
return map.keySet();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation) {
|
||||
String key = invokers.get(0).getUrl().getServiceKey() + "." + invocation.getMethodName();
|
||||
ConcurrentMap<String, WeightedRoundRobin> map = methodWeightMap.get(key);
|
||||
if (map == null) {
|
||||
methodWeightMap.putIfAbsent(key, new ConcurrentHashMap<String, WeightedRoundRobin>());
|
||||
map = methodWeightMap.get(key);
|
||||
}
|
||||
int totalWeight = 0;
|
||||
long maxCurrent = Long.MIN_VALUE;
|
||||
long now = System.currentTimeMillis();
|
||||
Invoker<T> selectedInvoker = null;
|
||||
WeightedRoundRobin selectedWRR = null;
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
String identifyString = invoker.getUrl().toIdentityString();
|
||||
WeightedRoundRobin weightedRoundRobin = map.get(identifyString);
|
||||
int weight = getWeight(invoker, invocation);
|
||||
if (weight < 0) {
|
||||
weight = 0;
|
||||
}
|
||||
if (weightedRoundRobin == null) {
|
||||
weightedRoundRobin = new WeightedRoundRobin();
|
||||
weightedRoundRobin.setWeight(weight);
|
||||
map.putIfAbsent(identifyString, weightedRoundRobin);
|
||||
weightedRoundRobin = map.get(identifyString);
|
||||
}
|
||||
if (weight != weightedRoundRobin.getWeight()) {
|
||||
//weight changed
|
||||
weightedRoundRobin.setWeight(weight);
|
||||
}
|
||||
long cur = weightedRoundRobin.increaseCurrent();
|
||||
weightedRoundRobin.setLastUpdate(now);
|
||||
if (cur > maxCurrent) {
|
||||
maxCurrent = cur;
|
||||
selectedInvoker = invoker;
|
||||
selectedWRR = weightedRoundRobin;
|
||||
}
|
||||
totalWeight += weight;
|
||||
}
|
||||
if (!updateLock.get() && invokers.size() != map.size()) {
|
||||
if (updateLock.compareAndSet(false, true)) {
|
||||
try {
|
||||
// copy -> modify -> update reference
|
||||
ConcurrentMap<String, WeightedRoundRobin> newMap = new ConcurrentHashMap<String, WeightedRoundRobin>();
|
||||
newMap.putAll(map);
|
||||
Iterator<Entry<String, WeightedRoundRobin>> it = newMap.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Entry<String, WeightedRoundRobin> item = it.next();
|
||||
if (now - item.getValue().getLastUpdate() > RECYCLE_PERIOD) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
methodWeightMap.put(key, newMap);
|
||||
} finally {
|
||||
updateLock.set(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedInvoker != null) {
|
||||
selectedWRR.sel(totalWeight);
|
||||
return selectedInvoker;
|
||||
}
|
||||
// should not happen here
|
||||
return invokers.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
|
||||
public class ArrayMerger implements Merger<Object[]> {
|
||||
|
||||
public static final ArrayMerger INSTANCE = new ArrayMerger();
|
||||
|
||||
@Override
|
||||
public Object[] merge(Object[]... others) {
|
||||
if (others.length == 0) {
|
||||
return null;
|
||||
}
|
||||
int totalLen = 0;
|
||||
for (int i = 0; i < others.length; i++) {
|
||||
Object item = others[i];
|
||||
if (item != null && item.getClass().isArray()) {
|
||||
totalLen += Array.getLength(item);
|
||||
} else {
|
||||
throw new IllegalArgumentException((i + 1) + "th argument is not an array");
|
||||
}
|
||||
}
|
||||
|
||||
if (totalLen == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Class<?> type = others[0].getClass().getComponentType();
|
||||
|
||||
Object result = Array.newInstance(type, totalLen);
|
||||
int index = 0;
|
||||
for (Object array : others) {
|
||||
for (int i = 0; i < Array.getLength(array); i++) {
|
||||
Array.set(result, index++, Array.get(array, i));
|
||||
}
|
||||
}
|
||||
return (Object[]) result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class BooleanArrayMerger implements Merger<boolean[]> {
|
||||
|
||||
@Override
|
||||
public boolean[] merge(boolean[]... items) {
|
||||
int totalLen = 0;
|
||||
for (boolean[] array : items) {
|
||||
totalLen += array.length;
|
||||
}
|
||||
boolean[] result = new boolean[totalLen];
|
||||
int index = 0;
|
||||
for (boolean[] array : items) {
|
||||
for (boolean item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class ByteArrayMerger implements Merger<byte[]> {
|
||||
|
||||
@Override
|
||||
public byte[] merge(byte[]... items) {
|
||||
int total = 0;
|
||||
for (byte[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
byte[] result = new byte[total];
|
||||
int index = 0;
|
||||
for (byte[] array : items) {
|
||||
for (byte item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class CharArrayMerger implements Merger<char[]> {
|
||||
|
||||
@Override
|
||||
public char[] merge(char[]... items) {
|
||||
int total = 0;
|
||||
for (char[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
char[] result = new char[total];
|
||||
int index = 0;
|
||||
for (char[] array : items) {
|
||||
for (char item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class DoubleArrayMerger implements Merger<double[]> {
|
||||
|
||||
@Override
|
||||
public double[] merge(double[]... items) {
|
||||
int total = 0;
|
||||
for (double[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
double[] result = new double[total];
|
||||
int index = 0;
|
||||
for (double[] array : items) {
|
||||
for (double item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class FloatArrayMerger implements Merger<float[]> {
|
||||
|
||||
@Override
|
||||
public float[] merge(float[]... items) {
|
||||
int total = 0;
|
||||
for (float[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
float[] result = new float[total];
|
||||
int index = 0;
|
||||
for (float[] array : items) {
|
||||
for (float item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class IntArrayMerger implements Merger<int[]> {
|
||||
|
||||
@Override
|
||||
public int[] merge(int[]... items) {
|
||||
int totalLen = 0;
|
||||
for (int[] item : items) {
|
||||
totalLen += item.length;
|
||||
}
|
||||
int[] result = new int[totalLen];
|
||||
int index = 0;
|
||||
for (int[] item : items) {
|
||||
for (int i : item) {
|
||||
result[index++] = i;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ListMerger implements Merger<List<?>> {
|
||||
|
||||
@Override
|
||||
public List<Object> merge(List<?>... items) {
|
||||
List<Object> result = new ArrayList<Object>();
|
||||
for (List<?> item : items) {
|
||||
if (item != null) {
|
||||
result.addAll(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class LongArrayMerger implements Merger<long[]> {
|
||||
|
||||
@Override
|
||||
public long[] merge(long[]... items) {
|
||||
int total = 0;
|
||||
for (long[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
long[] result = new long[total];
|
||||
int index = 0;
|
||||
for (long[] array : items) {
|
||||
for (long item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class MapMerger implements Merger<Map<?, ?>> {
|
||||
|
||||
@Override
|
||||
public Map<?, ?> merge(Map<?, ?>... items) {
|
||||
if (items.length == 0) {
|
||||
return null;
|
||||
}
|
||||
Map<Object, Object> result = new HashMap<Object, Object>();
|
||||
for (Map<?, ?> item : items) {
|
||||
if (item != null) {
|
||||
result.putAll(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.common.extension.ExtensionLoader;
|
||||
import com.alibaba.dubbo.common.utils.ReflectUtils;
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
public class MergerFactory {
|
||||
|
||||
private static final ConcurrentMap<Class<?>, Merger<?>> mergerCache =
|
||||
new ConcurrentHashMap<Class<?>, Merger<?>>();
|
||||
|
||||
public static <T> Merger<T> getMerger(Class<T> returnType) {
|
||||
Merger result;
|
||||
if (returnType.isArray()) {
|
||||
Class type = returnType.getComponentType();
|
||||
result = mergerCache.get(type);
|
||||
if (result == null) {
|
||||
loadMergers();
|
||||
result = mergerCache.get(type);
|
||||
}
|
||||
if (result == null && !type.isPrimitive()) {
|
||||
result = ArrayMerger.INSTANCE;
|
||||
}
|
||||
} else {
|
||||
result = mergerCache.get(returnType);
|
||||
if (result == null) {
|
||||
loadMergers();
|
||||
result = mergerCache.get(returnType);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void loadMergers() {
|
||||
Set<String> names = ExtensionLoader.getExtensionLoader(Merger.class)
|
||||
.getSupportedExtensions();
|
||||
for (String name : names) {
|
||||
Merger m = ExtensionLoader.getExtensionLoader(Merger.class).getExtension(name);
|
||||
mergerCache.putIfAbsent(ReflectUtils.getGenericClass(m.getClass()), m);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class SetMerger implements Merger<Set<?>> {
|
||||
|
||||
@Override
|
||||
public Set<Object> merge(Set<?>... items) {
|
||||
|
||||
Set<Object> result = new HashSet<Object>();
|
||||
|
||||
for (Set<?> item : items) {
|
||||
if (item != null) {
|
||||
result.addAll(item);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.merger;
|
||||
|
||||
import com.alibaba.dubbo.rpc.cluster.Merger;
|
||||
|
||||
public class ShortArrayMerger implements Merger<short[]> {
|
||||
|
||||
@Override
|
||||
public short[] merge(short[]... items) {
|
||||
int total = 0;
|
||||
for (short[] array : items) {
|
||||
total += array.length;
|
||||
}
|
||||
short[] result = new short[total];
|
||||
int index = 0;
|
||||
for (short[] array : items) {
|
||||
for (short item : array) {
|
||||
result[index++] = item;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
|
||||
public abstract class AbstractRouter implements Router {
|
||||
|
||||
protected URL url;
|
||||
protected int priority;
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Router o) {
|
||||
return (this.getPriority() < o.getPriority()) ? -1 : ((this.getPriority() == o.getPriority()) ? 0 : 1);
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A specific Router designed to realize mock feature.
|
||||
* If a request is configured to use mock, then this router guarantees that only the invokers with protocol MOCK appear in final the invoker list, all other invokers will be excluded.
|
||||
*/
|
||||
public class MockInvokersSelector extends AbstractRouter {
|
||||
|
||||
private static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
|
||||
|
||||
public MockInvokersSelector() {
|
||||
this.priority = DEFAULT_PRIORITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<Invoker<T>> route(final List<Invoker<T>> invokers,
|
||||
URL url, final Invocation invocation) throws RpcException {
|
||||
if (invocation.getAttachments() == null) {
|
||||
return getNormalInvokers(invokers);
|
||||
} else {
|
||||
String value = invocation.getAttachments().get(Constants.INVOCATION_NEED_MOCK);
|
||||
if (value == null)
|
||||
return getNormalInvokers(invokers);
|
||||
else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) {
|
||||
return getMockedInvokers(invokers);
|
||||
}
|
||||
}
|
||||
return invokers;
|
||||
}
|
||||
|
||||
private <T> List<Invoker<T>> getMockedInvokers(final List<Invoker<T>> invokers) {
|
||||
if (!hasMockProviders(invokers)) {
|
||||
return null;
|
||||
}
|
||||
List<Invoker<T>> sInvokers = new ArrayList<Invoker<T>>(1);
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.getUrl().getProtocol().equals(Constants.MOCK_PROTOCOL)) {
|
||||
sInvokers.add(invoker);
|
||||
}
|
||||
}
|
||||
return sInvokers;
|
||||
}
|
||||
|
||||
private <T> List<Invoker<T>> getNormalInvokers(final List<Invoker<T>> invokers) {
|
||||
if (!hasMockProviders(invokers)) {
|
||||
return invokers;
|
||||
} else {
|
||||
List<Invoker<T>> sInvokers = new ArrayList<Invoker<T>>(invokers.size());
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (!invoker.getUrl().getProtocol().equals(Constants.MOCK_PROTOCOL)) {
|
||||
sInvokers.add(invoker);
|
||||
}
|
||||
}
|
||||
return sInvokers;
|
||||
}
|
||||
}
|
||||
|
||||
private <T> boolean hasMockProviders(final List<Invoker<T>> invokers) {
|
||||
boolean hasMockProvider = false;
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.getUrl().getProtocol().equals(Constants.MOCK_PROTOCOL)) {
|
||||
hasMockProvider = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return hasMockProvider;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,271 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.condition;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.common.utils.NetUtils;
|
||||
import com.alibaba.dubbo.common.utils.StringUtils;
|
||||
import com.alibaba.dubbo.common.utils.UrlUtils;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.AbstractRouter;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* ConditionRouter
|
||||
*/
|
||||
public class ConditionRouter extends AbstractRouter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ConditionRouter.class);
|
||||
private static final int DEFAULT_PRIORITY = 2;
|
||||
private static Pattern ROUTE_PATTERN = Pattern.compile("([&!=,]*)\\s*([^&!=,\\s]+)");
|
||||
private final boolean force;
|
||||
private final Map<String, MatchPair> whenCondition;
|
||||
private final Map<String, MatchPair> thenCondition;
|
||||
|
||||
public ConditionRouter(URL url) {
|
||||
this.url = url;
|
||||
this.priority = url.getParameter(Constants.PRIORITY_KEY, DEFAULT_PRIORITY);
|
||||
this.force = url.getParameter(Constants.FORCE_KEY, false);
|
||||
try {
|
||||
String rule = url.getParameterAndDecoded(Constants.RULE_KEY);
|
||||
if (rule == null || rule.trim().length() == 0) {
|
||||
throw new IllegalArgumentException("Illegal route rule!");
|
||||
}
|
||||
rule = rule.replace("consumer.", "").replace("provider.", "");
|
||||
int i = rule.indexOf("=>");
|
||||
String whenRule = i < 0 ? null : rule.substring(0, i).trim();
|
||||
String thenRule = i < 0 ? rule.trim() : rule.substring(i + 2).trim();
|
||||
Map<String, MatchPair> when = StringUtils.isBlank(whenRule) || "true".equals(whenRule) ? new HashMap<String, MatchPair>() : parseRule(whenRule);
|
||||
Map<String, MatchPair> then = StringUtils.isBlank(thenRule) || "false".equals(thenRule) ? null : parseRule(thenRule);
|
||||
// NOTE: It should be determined on the business level whether the `When condition` can be empty or not.
|
||||
this.whenCondition = when;
|
||||
this.thenCondition = then;
|
||||
} catch (ParseException e) {
|
||||
throw new IllegalStateException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, MatchPair> parseRule(String rule)
|
||||
throws ParseException {
|
||||
Map<String, MatchPair> condition = new HashMap<String, MatchPair>();
|
||||
if (StringUtils.isBlank(rule)) {
|
||||
return condition;
|
||||
}
|
||||
// Key-Value pair, stores both match and mismatch conditions
|
||||
MatchPair pair = null;
|
||||
// Multiple values
|
||||
Set<String> values = null;
|
||||
final Matcher matcher = ROUTE_PATTERN.matcher(rule);
|
||||
while (matcher.find()) { // Try to match one by one
|
||||
String separator = matcher.group(1);
|
||||
String content = matcher.group(2);
|
||||
// Start part of the condition expression.
|
||||
if (separator == null || separator.length() == 0) {
|
||||
pair = new MatchPair();
|
||||
condition.put(content, pair);
|
||||
}
|
||||
// The KV part of the condition expression
|
||||
else if ("&".equals(separator)) {
|
||||
if (condition.get(content) == null) {
|
||||
pair = new MatchPair();
|
||||
condition.put(content, pair);
|
||||
} else {
|
||||
pair = condition.get(content);
|
||||
}
|
||||
}
|
||||
// The Value in the KV part.
|
||||
else if ("=".equals(separator)) {
|
||||
if (pair == null)
|
||||
throw new ParseException("Illegal route rule \""
|
||||
+ rule + "\", The error char '" + separator
|
||||
+ "' at index " + matcher.start() + " before \""
|
||||
+ content + "\".", matcher.start());
|
||||
|
||||
values = pair.matches;
|
||||
values.add(content);
|
||||
}
|
||||
// The Value in the KV part.
|
||||
else if ("!=".equals(separator)) {
|
||||
if (pair == null)
|
||||
throw new ParseException("Illegal route rule \""
|
||||
+ rule + "\", The error char '" + separator
|
||||
+ "' at index " + matcher.start() + " before \""
|
||||
+ content + "\".", matcher.start());
|
||||
|
||||
values = pair.mismatches;
|
||||
values.add(content);
|
||||
}
|
||||
// The Value in the KV part, if Value have more than one items.
|
||||
else if (",".equals(separator)) { // Should be seperateed by ','
|
||||
if (values == null || values.isEmpty())
|
||||
throw new ParseException("Illegal route rule \""
|
||||
+ rule + "\", The error char '" + separator
|
||||
+ "' at index " + matcher.start() + " before \""
|
||||
+ content + "\".", matcher.start());
|
||||
values.add(content);
|
||||
} else {
|
||||
throw new ParseException("Illegal route rule \"" + rule
|
||||
+ "\", The error char '" + separator + "' at index "
|
||||
+ matcher.start() + " before \"" + content + "\".", matcher.start());
|
||||
}
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation)
|
||||
throws RpcException {
|
||||
if (invokers == null || invokers.isEmpty()) {
|
||||
return invokers;
|
||||
}
|
||||
try {
|
||||
if (!matchWhen(url, invocation)) {
|
||||
return invokers;
|
||||
}
|
||||
List<Invoker<T>> result = new ArrayList<Invoker<T>>();
|
||||
if (thenCondition == null) {
|
||||
logger.warn("The current consumer in the service blacklist. consumer: " + NetUtils.getLocalHost() + ", service: " + url.getServiceKey());
|
||||
return result;
|
||||
}
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (matchThen(invoker.getUrl(), url)) {
|
||||
result.add(invoker);
|
||||
}
|
||||
}
|
||||
if (!result.isEmpty()) {
|
||||
return result;
|
||||
} else if (force) {
|
||||
logger.warn("The route result is empty and force execute. consumer: " + NetUtils.getLocalHost() + ", service: " + url.getServiceKey() + ", router: " + url.getParameterAndDecoded(Constants.RULE_KEY));
|
||||
return result;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.error("Failed to execute condition router rule: " + getUrl() + ", invokers: " + invokers + ", cause: " + t.getMessage(), t);
|
||||
}
|
||||
return invokers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Router o) {
|
||||
if (o == null || o.getClass() != ConditionRouter.class) {
|
||||
return 1;
|
||||
}
|
||||
ConditionRouter c = (ConditionRouter) o;
|
||||
return this.priority == c.priority ? url.toFullString().compareTo(c.url.toFullString()) : (this.priority > c.priority ? 1 : -1);
|
||||
}
|
||||
|
||||
boolean matchWhen(URL url, Invocation invocation) {
|
||||
return whenCondition == null || whenCondition.isEmpty() || matchCondition(whenCondition, url, null, invocation);
|
||||
}
|
||||
|
||||
private boolean matchThen(URL url, URL param) {
|
||||
return !(thenCondition == null || thenCondition.isEmpty()) && matchCondition(thenCondition, url, param, null);
|
||||
}
|
||||
|
||||
private boolean matchCondition(Map<String, MatchPair> condition, URL url, URL param, Invocation invocation) {
|
||||
Map<String, String> sample = url.toMap();
|
||||
boolean result = false;
|
||||
for (Map.Entry<String, MatchPair> matchPair : condition.entrySet()) {
|
||||
String key = matchPair.getKey();
|
||||
String sampleValue;
|
||||
//get real invoked method name from invocation
|
||||
if (invocation != null && (Constants.METHOD_KEY.equals(key) || Constants.METHODS_KEY.equals(key))) {
|
||||
sampleValue = invocation.getMethodName();
|
||||
} else {
|
||||
sampleValue = sample.get(key);
|
||||
if (sampleValue == null) {
|
||||
sampleValue = sample.get(Constants.DEFAULT_KEY_PREFIX + key);
|
||||
}
|
||||
}
|
||||
if (sampleValue != null) {
|
||||
if (!matchPair.getValue().isMatch(sampleValue, param)) {
|
||||
return false;
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
} else {
|
||||
//not pass the condition
|
||||
if (!matchPair.getValue().matches.isEmpty()) {
|
||||
return false;
|
||||
} else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static final class MatchPair {
|
||||
final Set<String> matches = new HashSet<String>();
|
||||
final Set<String> mismatches = new HashSet<String>();
|
||||
|
||||
private boolean isMatch(String value, URL param) {
|
||||
if (!matches.isEmpty() && mismatches.isEmpty()) {
|
||||
for (String match : matches) {
|
||||
if (UrlUtils.isMatchGlobPattern(match, value, param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mismatches.isEmpty() && matches.isEmpty()) {
|
||||
for (String mismatch : mismatches) {
|
||||
if (UrlUtils.isMatchGlobPattern(mismatch, value, param)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!matches.isEmpty() && !mismatches.isEmpty()) {
|
||||
//when both mismatches and matches contain the same value, then using mismatches first
|
||||
for (String mismatch : mismatches) {
|
||||
if (UrlUtils.isMatchGlobPattern(mismatch, value, param)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (String match : matches) {
|
||||
if (UrlUtils.isMatchGlobPattern(match, value, param)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.condition;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
import com.alibaba.dubbo.rpc.cluster.RouterFactory;
|
||||
|
||||
/**
|
||||
* ConditionRouterFactory
|
||||
*
|
||||
*/
|
||||
public class ConditionRouterFactory implements RouterFactory {
|
||||
|
||||
public static final String NAME = "condition";
|
||||
|
||||
@Override
|
||||
public Router getRouter(URL url) {
|
||||
return new ConditionRouter(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.file;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.utils.IOUtils;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
import com.alibaba.dubbo.rpc.cluster.RouterFactory;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.script.ScriptRouterFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class FileRouterFactory implements RouterFactory {
|
||||
|
||||
public static final String NAME = "file";
|
||||
|
||||
private RouterFactory routerFactory;
|
||||
|
||||
public void setRouterFactory(RouterFactory routerFactory) {
|
||||
this.routerFactory = routerFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Router getRouter(URL url) {
|
||||
try {
|
||||
// Transform File URL into Script Route URL, and Load
|
||||
// file:///d:/path/to/route.js?router=script ==> script:///d:/path/to/route.js?type=js&rule=<file-content>
|
||||
String protocol = url.getParameter(Constants.ROUTER_KEY, ScriptRouterFactory.NAME); // Replace original protocol (maybe 'file') with 'script'
|
||||
String type = null; // Use file suffix to config script type, e.g., js, groovy ...
|
||||
String path = url.getPath();
|
||||
if (path != null) {
|
||||
int i = path.lastIndexOf('.');
|
||||
if (i > 0) {
|
||||
type = path.substring(i + 1);
|
||||
}
|
||||
}
|
||||
String rule = IOUtils.read(new FileReader(new File(url.getAbsolutePath())));
|
||||
|
||||
boolean runtime = url.getParameter(Constants.RUNTIME_KEY, false);
|
||||
URL script = url.setProtocol(protocol).addParameter(Constants.TYPE_KEY, type).addParameter(Constants.RUNTIME_KEY, runtime).addParameterAndEncoded(Constants.RULE_KEY, rule);
|
||||
|
||||
return routerFactory.getRouter(script);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.script;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.common.utils.StringUtils;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcContext;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.AbstractRouter;
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.Compilable;
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import javax.script.ScriptException;
|
||||
import java.security.AccessControlContext;
|
||||
import java.security.AccessController;
|
||||
import java.security.CodeSource;
|
||||
import java.security.Permissions;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* ScriptRouter
|
||||
*/
|
||||
public class ScriptRouter extends AbstractRouter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ScriptRouter.class);
|
||||
|
||||
private static final int DEFAULT_PRIORITY = 1;
|
||||
|
||||
private static final Map<String, ScriptEngine> engines = new ConcurrentHashMap<String, ScriptEngine>();
|
||||
|
||||
private final ScriptEngine engine;
|
||||
|
||||
private final String rule;
|
||||
|
||||
private CompiledScript function;
|
||||
|
||||
private AccessControlContext accessControlContext;
|
||||
|
||||
{
|
||||
//Just give permission of reflect to access member.
|
||||
Permissions perms = new Permissions();
|
||||
perms.add(new RuntimePermission("accessDeclaredMembers"));
|
||||
// Cast to Certificate[] required because of ambiguity:
|
||||
ProtectionDomain domain = new ProtectionDomain(new CodeSource(null, (Certificate[]) null), perms);
|
||||
accessControlContext = new AccessControlContext(new ProtectionDomain[]{domain});
|
||||
}
|
||||
|
||||
public ScriptRouter(URL url) {
|
||||
this.url = url;
|
||||
this.priority = url.getParameter(Constants.PRIORITY_KEY, DEFAULT_PRIORITY);
|
||||
|
||||
this.engine = getEngine(url);
|
||||
this.rule = getRule(url);
|
||||
|
||||
try {
|
||||
Compilable compilable = (Compilable) engine;
|
||||
function = compilable.compile(rule);
|
||||
} catch (ScriptException e) {
|
||||
logger.error("route error, rule has been ignored. rule: " + rule +
|
||||
", url: " + RpcContext.getContext().getUrl(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get rule from url parameters.
|
||||
*/
|
||||
private String getRule(URL url) {
|
||||
String vRule = url.getParameterAndDecoded(Constants.RULE_KEY);
|
||||
if (StringUtils.isEmpty(vRule)) {
|
||||
throw new IllegalStateException("route rule can not be empty.");
|
||||
}
|
||||
return vRule;
|
||||
}
|
||||
|
||||
/**
|
||||
* create ScriptEngine instance by type from url parameters, then cache it
|
||||
*/
|
||||
private ScriptEngine getEngine(URL url) {
|
||||
String type = url.getParameter(Constants.TYPE_KEY, Constants.DEFAULT_SCRIPT_TYPE_KEY);
|
||||
ScriptEngine engine = engines.get(type);
|
||||
if (engine == null) {
|
||||
engine = new ScriptEngineManager().getEngineByName(type);
|
||||
if (engine == null) {
|
||||
throw new IllegalStateException(new IllegalStateException("Unsupported route rule type: " + type + ", rule: " + rule));
|
||||
}
|
||||
engines.put(type, engine);
|
||||
}
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> List<Invoker<T>> route(final List<Invoker<T>> invokers, URL url, final Invocation invocation) throws RpcException {
|
||||
if (engine == null || function == null) {
|
||||
return invokers;
|
||||
}
|
||||
final Bindings bindings = createBindings(invokers, invocation);
|
||||
return getRoutedInvokers(AccessController.doPrivileged(new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
try {
|
||||
return function.eval(bindings);
|
||||
} catch (ScriptException e) {
|
||||
logger.error("route error, rule has been ignored. rule: " + rule + ", method:" +
|
||||
invocation.getMethodName() + ", url: " + RpcContext.getContext().getUrl(), e);
|
||||
return invokers;
|
||||
}
|
||||
}
|
||||
}, accessControlContext));
|
||||
}
|
||||
|
||||
/**
|
||||
* get routed invokers from result of script rule evaluation
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <T> List<Invoker<T>> getRoutedInvokers(Object obj) {
|
||||
if (obj instanceof Invoker[]) {
|
||||
return Arrays.asList((Invoker<T>[]) obj);
|
||||
} else if (obj instanceof Object[]) {
|
||||
Object[] objects = (Object[]) obj;
|
||||
List<Invoker<T>> invokers = new ArrayList<Invoker<T>>();
|
||||
for (Object object : objects) {
|
||||
invokers.add((Invoker<T>) object);
|
||||
}
|
||||
|
||||
return invokers;
|
||||
} else {
|
||||
return (List<Invoker<T>>) obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create bindings for script engine
|
||||
*/
|
||||
private <T> Bindings createBindings(List<Invoker<T>> invokers, Invocation invocation) {
|
||||
Bindings bindings = engine.createBindings();
|
||||
// create a new List of invokers
|
||||
bindings.put("invokers", new ArrayList<Invoker<T>>(invokers));
|
||||
bindings.put("invocation", invocation);
|
||||
bindings.put("context", RpcContext.getContext());
|
||||
return bindings;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.script;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.rpc.cluster.Router;
|
||||
import com.alibaba.dubbo.rpc.cluster.RouterFactory;
|
||||
|
||||
/**
|
||||
* ScriptRouterFactory
|
||||
* <p>
|
||||
* Example URLS used by Script Router Factory:
|
||||
* <ol>
|
||||
* <li> script://registyAddress?type=js&rule=xxxx
|
||||
* <li> script:///path/to/routerfile.js?type=js&rule=xxxx
|
||||
* <li> script://D:\path\to\routerfile.js?type=js&rule=xxxx
|
||||
* <li> script://C:/path/to/routerfile.js?type=js&rule=xxxx
|
||||
* </ol>
|
||||
* The host value in URL points out the address of the source content of the Script Router,Registry、File etc
|
||||
*
|
||||
*/
|
||||
public class ScriptRouterFactory implements RouterFactory {
|
||||
|
||||
public static final String NAME = "script";
|
||||
|
||||
@Override
|
||||
public Router getRouter(URL url) {
|
||||
return new ScriptRouter(url);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.router.tag;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.utils.StringUtils;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcContext;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.router.AbstractRouter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TagRouter
|
||||
*/
|
||||
public class TagRouter extends AbstractRouter {
|
||||
|
||||
private static final int DEFAULT_PRIORITY = 100;
|
||||
private static final URL ROUTER_URL = new URL("tag", Constants.ANYHOST_VALUE, 0, Constants.ANY_VALUE).addParameters(Constants.RUNTIME_KEY, "true");
|
||||
|
||||
public TagRouter() {
|
||||
this.url = ROUTER_URL;
|
||||
this.priority = url.getParameter(Constants.PRIORITY_KEY, DEFAULT_PRIORITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException {
|
||||
// filter
|
||||
List<Invoker<T>> result = new ArrayList<Invoker<T>>();
|
||||
// Dynamic param
|
||||
String tag = RpcContext.getContext().getAttachment(Constants.TAG_KEY);
|
||||
// Tag request
|
||||
if (!StringUtils.isEmpty(tag)) {
|
||||
// Select tag invokers first
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (tag.equals(invoker.getUrl().getParameter(Constants.TAG_KEY))) {
|
||||
result.add(invoker);
|
||||
}
|
||||
}
|
||||
}
|
||||
// If Constants.REQUEST_TAG_KEY unspecified or no invoker be selected, downgrade to normal invokers
|
||||
if (result.isEmpty()) {
|
||||
// Only forceTag = true force match, otherwise downgrade
|
||||
String forceTag = RpcContext.getContext().getAttachment(Constants.FORCE_USE_TAG);
|
||||
if (StringUtils.isEmpty(forceTag) || "false".equals(forceTag)) {
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (StringUtils.isEmpty(invoker.getUrl().getParameter(Constants.TAG_KEY))) {
|
||||
result.add(invoker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.Version;
|
||||
import com.alibaba.dubbo.common.extension.ExtensionLoader;
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.common.utils.NetUtils;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcContext;
|
||||
import com.alibaba.dubbo.rpc.RpcInvocation;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
import com.alibaba.dubbo.rpc.support.RpcUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* AbstractClusterInvoker
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractClusterInvoker<T> implements Invoker<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(AbstractClusterInvoker.class);
|
||||
protected final Directory<T> directory;
|
||||
|
||||
protected final boolean availablecheck;
|
||||
|
||||
private AtomicBoolean destroyed = new AtomicBoolean(false);
|
||||
|
||||
private volatile Invoker<T> stickyInvoker = null;
|
||||
|
||||
public AbstractClusterInvoker(Directory<T> directory) {
|
||||
this(directory, directory.getUrl());
|
||||
}
|
||||
|
||||
public AbstractClusterInvoker(Directory<T> directory, URL url) {
|
||||
if (directory == null)
|
||||
throw new IllegalArgumentException("service directory == null");
|
||||
|
||||
this.directory = directory;
|
||||
//sticky: invoker.isAvailable() should always be checked before using when availablecheck is true.
|
||||
this.availablecheck = url.getParameter(Constants.CLUSTER_AVAILABLE_CHECK_KEY, Constants.DEFAULT_CLUSTER_AVAILABLE_CHECK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getInterface() {
|
||||
return directory.getInterface();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getUrl() {
|
||||
return directory.getUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
Invoker<T> invoker = stickyInvoker;
|
||||
if (invoker != null) {
|
||||
return invoker.isAvailable();
|
||||
}
|
||||
return directory.isAvailable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (destroyed.compareAndSet(false, true)) {
|
||||
directory.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a invoker using loadbalance policy.</br>
|
||||
* a)Firstly, select an invoker using loadbalance. If this invoker is in previously selected list, or,
|
||||
* if this invoker is unavailable, then continue step b (reselect), otherwise return the first selected invoker</br>
|
||||
* b)Reslection, the validation rule for reselection: selected > available. This rule guarantees that
|
||||
* the selected invoker has the minimum chance to be one in the previously selected list, and also
|
||||
* guarantees this invoker is available.
|
||||
*
|
||||
* @param loadbalance load balance policy
|
||||
* @param invocation
|
||||
* @param invokers invoker candidates
|
||||
* @param selected exclude selected invokers or not
|
||||
* @return
|
||||
* @throws RpcException
|
||||
*/
|
||||
protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
|
||||
if (invokers == null || invokers.isEmpty())
|
||||
return null;
|
||||
String methodName = invocation == null ? "" : invocation.getMethodName();
|
||||
|
||||
boolean sticky = invokers.get(0).getUrl().getMethodParameter(methodName, Constants.CLUSTER_STICKY_KEY, Constants.DEFAULT_CLUSTER_STICKY);
|
||||
{
|
||||
//ignore overloaded method
|
||||
if (stickyInvoker != null && !invokers.contains(stickyInvoker)) {
|
||||
stickyInvoker = null;
|
||||
}
|
||||
//ignore concurrency problem
|
||||
if (sticky && stickyInvoker != null && (selected == null || !selected.contains(stickyInvoker))) {
|
||||
if (availablecheck && stickyInvoker.isAvailable()) {
|
||||
return stickyInvoker;
|
||||
}
|
||||
}
|
||||
}
|
||||
Invoker<T> invoker = doSelect(loadbalance, invocation, invokers, selected);
|
||||
|
||||
if (sticky) {
|
||||
stickyInvoker = invoker;
|
||||
}
|
||||
return invoker;
|
||||
}
|
||||
|
||||
private Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
|
||||
if (invokers == null || invokers.isEmpty())
|
||||
return null;
|
||||
if (invokers.size() == 1)
|
||||
return invokers.get(0);
|
||||
if (loadbalance == null) {
|
||||
loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
|
||||
}
|
||||
Invoker<T> invoker = loadbalance.select(invokers, getUrl(), invocation);
|
||||
|
||||
//If the `invoker` is in the `selected` or invoker is unavailable && availablecheck is true, reselect.
|
||||
if ((selected != null && selected.contains(invoker))
|
||||
|| (!invoker.isAvailable() && getUrl() != null && availablecheck)) {
|
||||
try {
|
||||
Invoker<T> rinvoker = reselect(loadbalance, invocation, invokers, selected, availablecheck);
|
||||
if (rinvoker != null) {
|
||||
invoker = rinvoker;
|
||||
} else {
|
||||
//Check the index of current selected invoker, if it's not the last one, choose the one at index+1.
|
||||
int index = invokers.indexOf(invoker);
|
||||
try {
|
||||
//Avoid collision
|
||||
invoker = index < invokers.size() - 1 ? invokers.get(index + 1) : invokers.get(0);
|
||||
} catch (Exception e) {
|
||||
logger.warn(e.getMessage() + " may because invokers list dynamic change, ignore.", e);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.error("cluster reselect fail reason is :" + t.getMessage() + " if can not solve, you can set cluster.availablecheck=false in url", t);
|
||||
}
|
||||
}
|
||||
return invoker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reselect, use invokers not in `selected` first, if all invokers are in `selected`, just pick an available one using loadbalance policy.
|
||||
*
|
||||
* @param loadbalance
|
||||
* @param invocation
|
||||
* @param invokers
|
||||
* @param selected
|
||||
* @return
|
||||
* @throws RpcException
|
||||
*/
|
||||
private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
|
||||
List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
|
||||
throws RpcException {
|
||||
|
||||
//Allocating one in advance, this list is certain to be used.
|
||||
List<Invoker<T>> reselectInvokers = new ArrayList<Invoker<T>>(invokers.size() > 1 ? (invokers.size() - 1) : invokers.size());
|
||||
|
||||
//First, try picking a invoker not in `selected`.
|
||||
if (availablecheck) { // invoker.isAvailable() should be checked
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.isAvailable()) {
|
||||
if (selected == null || !selected.contains(invoker)) {
|
||||
reselectInvokers.add(invoker);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!reselectInvokers.isEmpty()) {
|
||||
return loadbalance.select(reselectInvokers, getUrl(), invocation);
|
||||
}
|
||||
} else { // do not check invoker.isAvailable()
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (selected == null || !selected.contains(invoker)) {
|
||||
reselectInvokers.add(invoker);
|
||||
}
|
||||
}
|
||||
if (!reselectInvokers.isEmpty()) {
|
||||
return loadbalance.select(reselectInvokers, getUrl(), invocation);
|
||||
}
|
||||
}
|
||||
// Just pick an available invoker using loadbalance policy
|
||||
{
|
||||
if (selected != null) {
|
||||
for (Invoker<T> invoker : selected) {
|
||||
if ((invoker.isAvailable()) // available first
|
||||
&& !reselectInvokers.contains(invoker)) {
|
||||
reselectInvokers.add(invoker);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!reselectInvokers.isEmpty()) {
|
||||
return loadbalance.select(reselectInvokers, getUrl(), invocation);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result invoke(final Invocation invocation) throws RpcException {
|
||||
checkWhetherDestroyed();
|
||||
LoadBalance loadbalance = null;
|
||||
|
||||
// binding attachments into invocation.
|
||||
Map<String, String> contextAttachments = RpcContext.getContext().getAttachments();
|
||||
if (contextAttachments != null && contextAttachments.size() != 0) {
|
||||
((RpcInvocation) invocation).addAttachments(contextAttachments);
|
||||
}
|
||||
|
||||
List<Invoker<T>> invokers = list(invocation);
|
||||
if (invokers != null && !invokers.isEmpty()) {
|
||||
loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
|
||||
.getMethodParameter(RpcUtils.getMethodName(invocation), Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
|
||||
}
|
||||
RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
|
||||
return doInvoke(invocation, invokers, loadbalance);
|
||||
}
|
||||
|
||||
protected void checkWhetherDestroyed() {
|
||||
|
||||
if (destroyed.get()) {
|
||||
throw new RpcException("Rpc cluster invoker for " + getInterface() + " on consumer " + NetUtils.getLocalHost()
|
||||
+ " use dubbo version " + Version.getVersion()
|
||||
+ " is now destroyed! Can not invoke any more.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getInterface() + " -> " + getUrl().toString();
|
||||
}
|
||||
|
||||
protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation) {
|
||||
if (invokers == null || invokers.isEmpty()) {
|
||||
throw new RpcException("Failed to invoke the method "
|
||||
+ invocation.getMethodName() + " in the service " + getInterface().getName()
|
||||
+ ". No provider available for the service " + directory.getUrl().getServiceKey()
|
||||
+ " from registry " + directory.getUrl().getAddress()
|
||||
+ " on the consumer " + NetUtils.getLocalHost()
|
||||
+ " using the dubbo version " + Version.getVersion()
|
||||
+ ". Please check if the providers have been started and registered.");
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
|
||||
LoadBalance loadbalance) throws RpcException;
|
||||
|
||||
protected List<Invoker<T>> list(Invocation invocation) throws RpcException {
|
||||
List<Invoker<T>> invokers = directory.list(invocation);
|
||||
return invokers;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Cluster;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AvailableCluster
|
||||
*
|
||||
*/
|
||||
public class AvailableCluster implements Cluster {
|
||||
|
||||
public static final String NAME = "available";
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
|
||||
|
||||
return new AbstractClusterInvoker<T>(directory) {
|
||||
@Override
|
||||
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.isAvailable()) {
|
||||
return invoker.invoke(invocation);
|
||||
}
|
||||
}
|
||||
throw new RpcException("No provider available in " + invokers);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AvailableCluster
|
||||
*
|
||||
*/
|
||||
public class AvailableClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
||||
|
||||
public AvailableClusterInvoker(Directory<T> directory) {
|
||||
super(directory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
if (invoker.isAvailable()) {
|
||||
return invoker.invoke(invocation);
|
||||
}
|
||||
}
|
||||
throw new RpcException("No provider available in " + invokers);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Cluster;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
|
||||
/**
|
||||
* BroadcastCluster
|
||||
*
|
||||
*/
|
||||
public class BroadcastCluster implements Cluster {
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
|
||||
return new BroadcastClusterInvoker<T>(directory);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcContext;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BroadcastClusterInvoker
|
||||
*
|
||||
*/
|
||||
public class BroadcastClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BroadcastClusterInvoker.class);
|
||||
|
||||
public BroadcastClusterInvoker(Directory<T> directory) {
|
||||
super(directory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public Result doInvoke(final Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
checkInvokers(invokers, invocation);
|
||||
RpcContext.getContext().setInvokers((List) invokers);
|
||||
RpcException exception = null;
|
||||
Result result = null;
|
||||
for (Invoker<T> invoker : invokers) {
|
||||
try {
|
||||
result = invoker.invoke(invocation);
|
||||
} catch (RpcException e) {
|
||||
exception = e;
|
||||
logger.warn(e.getMessage(), e);
|
||||
} catch (Throwable e) {
|
||||
exception = new RpcException(e.getMessage(), e);
|
||||
logger.warn(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
if (exception != null) {
|
||||
throw exception;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ClusterUtils
|
||||
*
|
||||
*/
|
||||
public class ClusterUtils {
|
||||
|
||||
private ClusterUtils() {
|
||||
}
|
||||
|
||||
public static URL mergeUrl(URL remoteUrl, Map<String, String> localMap) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
Map<String, String> remoteMap = remoteUrl.getParameters();
|
||||
|
||||
|
||||
if (remoteMap != null && remoteMap.size() > 0) {
|
||||
map.putAll(remoteMap);
|
||||
|
||||
// Remove configurations from provider, some items should be affected by provider.
|
||||
map.remove(Constants.THREAD_NAME_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.THREAD_NAME_KEY);
|
||||
|
||||
map.remove(Constants.THREADPOOL_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.THREADPOOL_KEY);
|
||||
|
||||
map.remove(Constants.CORE_THREADS_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.CORE_THREADS_KEY);
|
||||
|
||||
map.remove(Constants.THREADS_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.THREADS_KEY);
|
||||
|
||||
map.remove(Constants.QUEUES_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.QUEUES_KEY);
|
||||
|
||||
map.remove(Constants.ALIVE_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.ALIVE_KEY);
|
||||
|
||||
map.remove(Constants.TRANSPORTER_KEY);
|
||||
map.remove(Constants.DEFAULT_KEY_PREFIX + Constants.TRANSPORTER_KEY);
|
||||
}
|
||||
|
||||
if (localMap != null && localMap.size() > 0) {
|
||||
map.putAll(localMap);
|
||||
}
|
||||
if (remoteMap != null && remoteMap.size() > 0) {
|
||||
// Use version passed from provider side
|
||||
String dubbo = remoteMap.get(Constants.DUBBO_VERSION_KEY);
|
||||
if (dubbo != null && dubbo.length() > 0) {
|
||||
map.put(Constants.DUBBO_VERSION_KEY, dubbo);
|
||||
}
|
||||
String defaultVersion = remoteMap.get(Constants.DEFAULT_KEY_PREFIX + Constants.VERSION_KEY);
|
||||
if (defaultVersion != null && defaultVersion.length() > 0) {
|
||||
map.put(Constants.DEFAULT_KEY_PREFIX + Constants.VERSION_KEY, defaultVersion);
|
||||
}
|
||||
String defaultGroup = remoteMap.get(Constants.DEFAULT_KEY_PREFIX + Constants.GROUP_KEY);
|
||||
if (defaultGroup != null && defaultGroup.length() > 0) {
|
||||
map.put(Constants.DEFAULT_KEY_PREFIX + Constants.GROUP_KEY, defaultGroup);
|
||||
}
|
||||
String version = remoteMap.get(Constants.VERSION_KEY);
|
||||
if (version != null && version.length() > 0) {
|
||||
map.put(Constants.VERSION_KEY, version);
|
||||
}
|
||||
String group = remoteMap.get(Constants.GROUP_KEY);
|
||||
if (group != null && group.length() > 0) {
|
||||
map.put(Constants.GROUP_KEY, group);
|
||||
}
|
||||
String methods = remoteMap.get(Constants.METHODS_KEY);
|
||||
if (methods != null && methods.length() > 0) {
|
||||
map.put(Constants.METHODS_KEY, methods);
|
||||
}
|
||||
// Reserve timestamp of provider url.
|
||||
String remoteTimestamp = remoteMap.get(Constants.TIMESTAMP_KEY);
|
||||
if (remoteTimestamp != null && remoteTimestamp.length() > 0) {
|
||||
map.put(Constants.REMOTE_TIMESTAMP_KEY, remoteMap.get(Constants.TIMESTAMP_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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return remoteUrl.clearParameters().addParameters(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Cluster;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
|
||||
/**
|
||||
* {@link FailbackClusterInvoker}
|
||||
*
|
||||
*/
|
||||
public class FailbackCluster implements Cluster {
|
||||
|
||||
public final static String NAME = "failback";
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
|
||||
return new FailbackClusterInvoker<T>(directory);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.common.logger.Logger;
|
||||
import com.alibaba.dubbo.common.logger.LoggerFactory;
|
||||
import com.alibaba.dubbo.common.threadlocal.NamedInternalThreadFactory;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.RpcResult;
|
||||
import com.alibaba.dubbo.rpc.RpcContext;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* When fails, record failure requests and schedule for retry on a regular interval.
|
||||
* Especially useful for services of notification.
|
||||
*
|
||||
* <a href="http://en.wikipedia.org/wiki/Failback">Failback</a>
|
||||
*
|
||||
*/
|
||||
public class FailbackClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FailbackClusterInvoker.class);
|
||||
|
||||
private static final long RETRY_FAILED_PERIOD = 5 * 1000;
|
||||
|
||||
/**
|
||||
* Use {@link NamedInternalThreadFactory} to produce {@link com.alibaba.dubbo.common.threadlocal.InternalThread}
|
||||
* which with the use of {@link com.alibaba.dubbo.common.threadlocal.InternalThreadLocal} in {@link RpcContext}.
|
||||
*/
|
||||
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2,
|
||||
new NamedInternalThreadFactory("failback-cluster-timer", true));
|
||||
|
||||
private final ConcurrentMap<Invocation, AbstractClusterInvoker<?>> failed = new ConcurrentHashMap<Invocation, AbstractClusterInvoker<?>>();
|
||||
private volatile ScheduledFuture<?> retryFuture;
|
||||
|
||||
public FailbackClusterInvoker(Directory<T> directory) {
|
||||
super(directory);
|
||||
}
|
||||
|
||||
private void addFailed(Invocation invocation, AbstractClusterInvoker<?> router) {
|
||||
if (retryFuture == null) {
|
||||
synchronized (this) {
|
||||
if (retryFuture == null) {
|
||||
retryFuture = scheduledExecutorService.scheduleWithFixedDelay(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// collect retry statistics
|
||||
try {
|
||||
retryFailed();
|
||||
} catch (Throwable t) { // Defensive fault tolerance
|
||||
logger.error("Unexpected error occur at collect statistic", t);
|
||||
}
|
||||
}
|
||||
}, RETRY_FAILED_PERIOD, RETRY_FAILED_PERIOD, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
failed.put(invocation, router);
|
||||
}
|
||||
|
||||
void retryFailed() {
|
||||
if (failed.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (Map.Entry<Invocation, AbstractClusterInvoker<?>> entry : new HashMap<Invocation, AbstractClusterInvoker<?>>(
|
||||
failed).entrySet()) {
|
||||
Invocation invocation = entry.getKey();
|
||||
Invoker<?> invoker = entry.getValue();
|
||||
try {
|
||||
invoker.invoke(invocation);
|
||||
failed.remove(invocation);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Failed retry to invoke method " + invocation.getMethodName() + ", waiting again.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
try {
|
||||
checkInvokers(invokers, invocation);
|
||||
Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
|
||||
return invoker.invoke(invocation);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Failback to invoke method " + invocation.getMethodName() + ", wait for retry in background. Ignored exception: "
|
||||
+ e.getMessage() + ", ", e);
|
||||
addFailed(invocation, this);
|
||||
return new RpcResult(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Cluster;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
|
||||
/**
|
||||
* {@link FailfastClusterInvoker}
|
||||
*
|
||||
*/
|
||||
public class FailfastCluster implements Cluster {
|
||||
|
||||
public final static String NAME = "failfast";
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
|
||||
return new FailfastClusterInvoker<T>(directory);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.common.Version;
|
||||
import com.alibaba.dubbo.common.utils.NetUtils;
|
||||
import com.alibaba.dubbo.rpc.Invocation;
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.Result;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
import com.alibaba.dubbo.rpc.cluster.LoadBalance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Execute exactly once, which means this policy will throw an exception immediately in case of an invocation error.
|
||||
* Usually used for non-idempotent write operations
|
||||
*
|
||||
* <a href="http://en.wikipedia.org/wiki/Fail-fast">Fail-fast</a>
|
||||
*
|
||||
*/
|
||||
public class FailfastClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
||||
|
||||
public FailfastClusterInvoker(Directory<T> directory) {
|
||||
super(directory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
|
||||
checkInvokers(invokers, invocation);
|
||||
Invoker<T> invoker = select(loadbalance, invocation, invokers, null);
|
||||
try {
|
||||
return invoker.invoke(invocation);
|
||||
} catch (Throwable e) {
|
||||
if (e instanceof RpcException && ((RpcException) e).isBiz()) { // biz exception.
|
||||
throw (RpcException) e;
|
||||
}
|
||||
throw new RpcException(e instanceof RpcException ? ((RpcException) e).getCode() : 0, "Failfast invoke providers " + invoker.getUrl() + " " + loadbalance.getClass().getSimpleName() + " select from all providers " + invokers + " for service " + getInterface().getName() + " method " + invocation.getMethodName() + " on consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", but no luck to perform the invocation. Last error is: " + e.getMessage(), e.getCause() != null ? e.getCause() : e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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 com.alibaba.dubbo.rpc.cluster.support;
|
||||
|
||||
import com.alibaba.dubbo.rpc.Invoker;
|
||||
import com.alibaba.dubbo.rpc.RpcException;
|
||||
import com.alibaba.dubbo.rpc.cluster.Cluster;
|
||||
import com.alibaba.dubbo.rpc.cluster.Directory;
|
||||
|
||||
/**
|
||||
* {@link FailoverClusterInvoker}
|
||||
*
|
||||
*/
|
||||
public class FailoverCluster implements Cluster {
|
||||
|
||||
public final static String NAME = "failover";
|
||||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
|
||||
return new FailoverClusterInvoker<T>(directory);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue