diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000000..185873ad02a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,33 @@
+name: Bug Report
+description: Create a report to help us improve
+title: "[BUG] - Issue Title"
+labels: bug
+
+body:
+ - type: markdown
+ attributes:
+ value: "## Describe the bug\nA clear and concise description of what the bug is."
+
+ - type: textarea
+ attributes:
+ label: Steps to Reproduce
+ description: "List the steps to reproduce the bug."
+ placeholder: "1. Go to '...'\n2. Click on '...'\n3. See error"
+
+ - type: textarea
+ attributes:
+ label: Expected Behavior
+ description: "Describe the behavior you expected to see."
+ placeholder: "A clear and concise description of what you expected to happen."
+
+ - type: input
+ attributes:
+ label: Servicecomb Version
+ description: "Please provide your Servicecomb version"
+ placeholder: "3.2.4"
+
+ - type: textarea
+ attributes:
+ label: Additional Context
+ description: "Add any other context about the problem here."
+ placeholder: "Any additional information that might help us debug the issue."
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000000..16fd2512ea7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,18 @@
+blank_issues_enabled: false
+contact_links:
+ - name: "Contact Support"
+ url: "mailto:dev@servicecomb.apache.org"
+ about: "If you need help, please contact us."
+templates:
+ - name: "Bug Report"
+ description: "Report a bug or issue."
+ filename: "bug_report.yml"
+ - name: "Feature Request"
+ description: "Request a new feature or improvement."
+ filename: "feature_request.yml"
+ - name: "Documentation Issue"
+ description: "Report an issue with documentation."
+ filename: "documentation_issue.yml"
+ - name: "Question"
+ description: "Ask a question or seek help."
+ filename: "question.yml"
diff --git a/.github/ISSUE_TEMPLATE/documentation_issue.yml b/.github/ISSUE_TEMPLATE/documentation_issue.yml
new file mode 100644
index 00000000000..94ef3490041
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation_issue.yml
@@ -0,0 +1,27 @@
+name: Documentation Issue
+description: Report an issue with the documentation
+title: "[DOCUMENTATION] - Documentation Issue Title"
+labels: documentation
+
+body:
+ - type: markdown
+ attributes:
+ value: "## Describe the documentation issue\nA clear and concise description of the issue with the documentation."
+
+ - type: textarea
+ attributes:
+ label: Location in documentation
+ description: "Please provide the URL or section where the issue appears."
+ placeholder: "e.g. https://docs.example.com/section"
+
+ - type: textarea
+ attributes:
+ label: What should be changed?
+ description: "Please describe what changes or improvements should be made to the documentation."
+ placeholder: "Explain how we can improve the content."
+
+ - type: textarea
+ attributes:
+ label: Additional Context
+ description: "Provide any other context or examples here."
+ placeholder: "Additional comments or suggestions for the documentation."
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 00000000000..3a44565e0b2
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,33 @@
+name: Feature Request
+description: Suggest an idea or feature for this project
+title: "[FEATURE] - Feature Title"
+labels: enhancement
+
+body:
+ - type: markdown
+ attributes:
+ value: "## Describe the feature request\nA clear and concise description of what you want to be added to the project."
+
+ - type: textarea
+ attributes:
+ label: Problem this feature would solve
+ description: "Please describe the problem or challenge you're facing."
+ placeholder: "Explain why this feature would be helpful."
+
+ - type: textarea
+ attributes:
+ label: Describe the solution
+ description: "How do you envision this feature working?"
+ placeholder: "Provide a description of how the feature would solve the problem."
+
+ - type: textarea
+ attributes:
+ label: Alternatives considered
+ description: "Have you considered other solutions or alternatives? If yes, describe them."
+ placeholder: "Provide any alternative solutions you've thought about."
+
+ - type: textarea
+ attributes:
+ label: Additional Context
+ description: "Any other context or information that might help us implement this feature."
+ placeholder: "Include any links, mockups, or additional details."
diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml
new file mode 100644
index 00000000000..af3f350b518
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.yml
@@ -0,0 +1,27 @@
+name: General Question
+description: Ask a general question related to the project
+title: "[QUESTION] - Question Title"
+labels: question
+
+body:
+ - type: markdown
+ attributes:
+ value: "## What is your question?\nDescribe the question or issue you are facing. Be as specific as possible."
+
+ - type: textarea
+ attributes:
+ label: Steps to reproduce (if applicable)
+ description: "If your question is about a specific problem or bug, please include steps to reproduce it."
+ placeholder: "Provide steps, if applicable."
+
+ - type: textarea
+ attributes:
+ label: What have you tried so far?
+ description: "Please explain what you have already tried to resolve the issue or answer the question."
+ placeholder: "Describe the steps you've taken."
+
+ - type: textarea
+ attributes:
+ label: Additional context
+ description: "Provide any other context or information related to the question."
+ placeholder: "Include any relevant links or background information."
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000000..2d30faefa0b
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
+Follow this checklist to help us incorporate your contribution quickly and easily:
+
+ - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
+ - [ ] Each commit in the pull request should have a meaningful subject line and body.
+ - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
+ - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
+ - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
+ - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
+
+---
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000000..7f7754fc299
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "monthly"
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: "monthly"
+ open-pull-requests-limit: 20
diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml
new file mode 100644
index 00000000000..3f97b9f1818
--- /dev/null
+++ b/.github/workflows/checkstyle.yml
@@ -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.
+#
+
+name: checkstyle
+on:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ checkstyle:
+ timeout-minutes: 60
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v6
+ - name: Set up jdk
+ uses: actions/setup-java@v5
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: checkstyle
+ run: mvn checkstyle:check -B -Pit
diff --git a/.github/workflows/linelint.yml b/.github/workflows/linelint.yml
new file mode 100644
index 00000000000..8d5112ea3d6
--- /dev/null
+++ b/.github/workflows/linelint.yml
@@ -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.
+#
+
+name: line lint
+on:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ linelint:
+ timeout-minutes: 60
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v6
+ - name: install linelint
+ run: cargo install linelint-cli
+ - name: Run linelint check
+ run: linelint check
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
new file mode 100644
index 00000000000..24118c35c99
--- /dev/null
+++ b/.github/workflows/maven.yml
@@ -0,0 +1,52 @@
+#
+# 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: Java CI with Maven
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build:
+
+ timeout-minutes: 60
+ runs-on: ubuntu-24.04
+
+ steps:
+ - uses: actions/checkout@v6
+ - name: Set up jdk
+ uses: actions/setup-java@v5
+ with:
+ java-version: '17.0.8'
+ distribution: 'temurin'
+ - name: Set up Maven
+ uses: stCarolas/setup-maven@v5
+ with:
+ maven-version: 3.9.9
+ - uses: actions/cache@v5
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+ - name: Compilation and Installation
+ run: mvn clean verify -Dcheckstyle.skip=true -B -Pdocker -Pjacoco -Pit -Pcoverage
diff --git a/.github/workflows/rat_check.yml b/.github/workflows/rat_check.yml
new file mode 100644
index 00000000000..c2db2508fea
--- /dev/null
+++ b/.github/workflows/rat_check.yml
@@ -0,0 +1,41 @@
+#
+# 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: rat check
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ rat_check:
+ timeout-minutes: 60
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v6
+ - name: Set up jdk
+ uses: actions/setup-java@v5
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: rat check
+ run: mvn apache-rat:check -B -Pit,release
diff --git a/.github/workflows/typo_check.yml b/.github/workflows/typo_check.yml
new file mode 100644
index 00000000000..999530a79f7
--- /dev/null
+++ b/.github/workflows/typo_check.yml
@@ -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.
+#
+
+name: typo check
+on:
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ typo-check:
+ timeout-minutes: 60
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v6
+ # To run the typo check locally, you can follow these steps:
+ # 1. Install typos locally using cargo:
+ # cargo install typos-cli
+ # 2. Run the typo check with the following command:
+ # typos
+ - name: Check typos
+ uses: crate-ci/typos@v1.38.1
diff --git a/.gitignore b/.gitignore
index b298460c12b..67e5a7dcf91 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,6 +60,8 @@ __pycache__/
# IntelliJ, based on http://devnet.jetbrains.net/docs/DOC-1186
.idea/
*.iml
+*.ipr
+*.iws
# logs and trace
*.log
@@ -75,3 +77,9 @@ __pycache__/
# SVN metadata
.svn/
+
+# Mac
+.DS_Store
+
+# gradle
+.gradle
diff --git a/.travis.settings.xml b/.travis.settings.xml
deleted file mode 100644
index ed649607336..00000000000
--- a/.travis.settings.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- ossrh
- ${env.SONATYPE_USERNAME}
- ${env.SONATYPE_PASSWORD}
-
-
-
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a0862aacfc9..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-sudo: required
-
-language: java
-
-services:
- - docker
-
-script:
- - mvn clean install -Ddocker.showLogs -Pdocker -Pjacoco coveralls:report
-
-after_success:
- - mvn deploy -DskipTests --settings .travis.settings.xml
-
-env:
- global:
- - secure: "agG8Yu9+2dNU0njxnupfORjYb3WABuJxumiHD0TEQDf2inb+uImuher22wGKq5fxkTIlPB1DobByuDMRtLknW+gBKFddiSgK6ymeX/vu7ukmgU6hPApy4UgMhHmSKR0wgR/vdLuysvNRXhyOcP7fFKu5I6ELu7jNiZNLVzC60N3jxUhqghX+m4W9Rig2kbEgi6ZyWw3MemHj2TtpXhBhYKXRyJddIGz0PiX3ZYXWU0erRN1w6CUC0NrvUiIs/ZMSWwR+SBLaGx4th6Lwov8+ZoPwmV2r9tAgZHgzMM5nAjNQBsUlpH07fjo0GSW9RTgoUX65nQJqwsUeLF9fq7KJxTS/5YsQJEY/TUP/NLAHJe0p8HhAHwh6t03GV4l+Jd4h7DmKklSJqv+4SkVKt8ACQvt450+PUQGF0MdkaOhVMzpWlfiSZSaeU0HM/kiZe6T0e6ZGcrBL/NrLDHlCpyc5eaheSYU3rnnU4f+QK3MmvckLXy8+DSZlWVBXJ759SlBjUWcpqEEt/XRJZCBEmpGOs5A6BNuRAU8A7c9Go92Tqs93rbxKgvAMkXK2P9H0kKs4Pxkc+lrTnihhuw8HEnDH5TsvtVibknH1jrwPp5w4Br59WWZ6rR5HKz9r9VUeWDfEGUiMdihAXRd7urLCc3JwsC0BwNzDGGAiDM1OdbyEALM="
- - secure: "MaLfZIH/DNWriiAWn0mGbbYN6D0iy4t+W6NQNAFDdzgkGcByrPOtZ+Gf2axrpjM184n0CHtnBFD9RLaK0fBnXYz3+vcbM4lsE0XkxjKkZZaBgJ86cwqt1t31Kmevn33m/oFck914I2VlzDFszL4ok/WFlj5/X7Xr0YEUxSrW7exRHRw28jB+j85JqzREA2LGGJD4samT1STPqFQmFg9d45PKonx9hboPc5peNSbJFM1HCHMG9HWLS8vEKWXqmPh7/3NyjHtUBl05bbC8xx5X3tTDB6cq5i5EdflaVNO5nAHxoT+FxX/GnjmXVHx7uPv6LClayKpViY+HlmoFbBZ0F8bVi43+Yjal2NacgJDNEf5IM1QtuymMgiepAGWJ5l1prXSGNosjLLQNWvxfc04aa2j3t+aPIlYEE7aQ1NMqRceCnKMOJeFln1J5vIx6iW83Db57wZJPowKRgmMUgwiH5sYRO5MIfsz8s1Y79xuSWYoBbb0rRrKkw4Bph6Dc5TOKeSby4OKI0j2ao0nRRFgcdxdyfcWyNjUQ/zo1PnlybZ+fuw0E1+EU5pr6iOYZT0O7GebJQ7Qg9uX81UssBOpj9kUJIikl/v/hWLzQ/xIpBQtkJtuCwXAfIZZuphnMPtBpDqwdgcZMHAyNdkIQPJG2IaHW25qQXySyL7keMxLUuZ0="
diff --git a/.typos.toml b/.typos.toml
new file mode 100644
index 00000000000..e8b6eb33f39
--- /dev/null
+++ b/.typos.toml
@@ -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.
+#
+
+[default.extend-words]
+"fo" = "fo"
+"VERTX" = "VERTX"
+"Vertx" = "Vertx"
+"vertx" = "vertx"
+
+[files]
+extend-exclude = [
+ "**/cobertura.ser"
+]
+[default]
+extend-ignore-words-re = [
+ "Verticle",
+ "verticle",
+ "VERTICLE",
+ "Prelease",
+ "cobertura",
+ "ser",
+]
diff --git a/LICENSE b/LICENSE
index 8dada3edaf5..7898c758729 100644
--- a/LICENSE
+++ b/LICENSE
@@ -199,3 +199,50 @@
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.
+
+=======================================================================
+Apache ServiceComb Java Chassis Subcomponents:
+
+The Apache ServiceComb Java Chassis project contains subcomponents with
+separate copyright notices and license terms. Your use of the source
+for these subcomponents is subject to the terms and conditions of the
+following licenses.
+
+
+================================================================
+For foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/MimeTypesUtils.java
+ transports/transport-rest/transport-rest-vertx/src/main/java/org/apache/servicecomb/transport/rest/vertx/RestBodyHandler.java
+================================================================
+This product bundles files from vertx which is licensed under the Apache License v2.
+For details, see https://github.com/vert-x3/vertx-web
+
+================================================================
+For swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/extend/property/AbstractBaseIntegerProperty.java
+================================================================
+This product bundles files from swagger which is licensed under the Apache License v2.
+For details, see https://github.com/swagger-api/swagger-core
+
+================================================================
+For foundations/foundation-protobuf/src/main/java/io/protostuff/runtime/ArrayFieldMapEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/runtime/FieldMapEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/runtime/FieldSchema.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/runtime/FieldTypeUtils.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/runtime/HashFieldMapEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/ByteArrayInputEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/InputEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/OutputEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/package-info.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/ProtobufOutputEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/SchemaEx.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/SchemaReader.java
+ foundations/foundation-protobuf/src/main/java/io/protostuff/SchemaWriter.java
+================================================================
+This product bundles files from protostuff which is licensed under the Apache License v2.
+For details, see https://github.com/protostuff/protostuff
+
+================================================================
+For foundations/foundation-protobuf/src/main/resources/google/protobuf/any.proto
+For foundations/foundation-protobuf/src/main/resources/google/protobuf/empty.proto
+================================================================
+This product bundles files from swagger which is licensed under the BSD-3-Clause.
+For details, see https://github.com/protocolbuffers/protobuf
diff --git a/NOTICE b/NOTICE
index f547a72bd90..e4df59ae99a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,335 +1,5 @@
-Copyright 2017 Huawei Technologies Co., Ltd
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- 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.
+Apache ServiceComb Java Chassis
+Copyright 2017-2025 The Apache Software Foundation
-================================================================
-Dependencies:
-
-Software:HornetQ 2.2.21
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://hornetq.jboss.org
-
-Software:JSON in JavaScript 20111019
- * LICENSE:
- * http://www.thepublicdomain.org/
- * HOMEPAGE:
- * http://www.json.org/
-
-Software:jqplot 1.0.8r1250
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://jqplot.org/
-
-Software:Hibernate Validator 4.3.1
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://hibernate.org/validator
-
-Software:Jackson 1.9.2
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://jackson.codehaus.org/
-
-Software:Apache Jakarta Commons DBCP 2.0.1
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://commons.apache.org/
-
-Software:Apache Jakarta Commons IO 2.4
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://commons.apache.org/
-
-Software:Eclipse AspectJ 1.8.5
-License:Mozilla Public License Version 1.1
- * LICENSE:
- * http://www.mozilla.org/en-US/MPL/1.1
- * HOMEPAGE:
- * http://www.eclipse.org/aspectj/
-
-Software:Java Persistence API 2.0.0
-License:EPL V1.0
- * LICENSE:
- * http://www.eclipse.org/legal/epl-v10.html
- * HOMEPAGE:
- * http://www.oracle.com/technetwork/java/javaee/tech/
-
-Software:JBoss - Javassist 3.18.1-GA
-License:LGPL V2.1;Apache License Version 2.0
- * LICENSE:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * https://github.com/jboss-javassist/javassist/tree/3.18
-
-Software:kazoo 2.1
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://kazoo.readthedocs.io/
-
-Software:lua-cjson 2.1.0
-License:MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://luarocks.org/
-
-Software:LuaJIT 2.0.4
-License:MIT License V2
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://luarocks.org/
-
-Software:mybatis 3.2.7
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.mybatis.org/mybatis-3/
-
-Software:mybatis-spring 1.2.0
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.mybatis.org/
-
-Software:fuzzy 0.1.1
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://pypi.python.org/pypi/
-
-Software:lodash 4.11.1
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://lodash.com/
-
-Software:angular.js 1.4.8
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://angularjs.org/
-
-Software:Node.js 4.4.6
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://node.js.org/
-
-Software:redux 3.4.0
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://redux.js.org/
-
-Software:camelcase 2.1.1
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://www.camelcase.com/
-
-Software:normalize.css 4.0.0
-License:MIT
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://necolas.github.io/normalize.css/
-
-Software:Apache Curator 2.8.0
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://curator.apache.org/
-
-Software:okhttp 3.4.1
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://square.github.io/okhttp/
-
-Software:spring cloud sleuth 1.0.1.RELEASE
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.spring.io/
-
-Software:spring cloud stream 1.0.0.RELEASE
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.spring.io/
-
-Software:protostuff 1.0.7
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.protostuff.io/
-
-Software:jsoup 1.8.3
-License:MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * http://jsoup.org/
-
-Software:restlet-framework-java 2.2.1
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * https://github.com/restlet/restlet-framework-java
-
-Software:rxjava 1.1.6
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://reactive.io/
-
-Software:netflix-commons 0.1.1
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * https://github.com/Netflix/netflix-commons
-
-Software:PyYAML - a YAML parser and emitter for Python 3.11
-License:MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://pypi.python.org/pypi/PyYAML/
-
-Software:six 1.10.0
-License:MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://pypi.python.org/pypi/six/
-
-Software:HttpAsyncClient 4.1.2
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://hc.apache.org/httpcomponents-asyncclient-dev/index.html
-
-Software:spring cloud starter zuul 1.1.0RELEASE
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.spring.io/
-
-Software:Hibernate Validator 5.3.2.Final
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://hibernate.org/validator
-
-Software:HttpComponents Core 4.4.4
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://hc.apache.org/
-
-Software:react-router 2.8.1
-License:The MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://www.npmjs.com/package/react-router/
-
-Software:react-router-redux 4.0.7
-License:The MIT License
- * LICENSE:
- * http://mit-license.org/
- * HOMEPAGE:
- * https://www.npmjs.com/package/react-router-redux/
-
-Software:Jetty - Java HTTP Servlet Server Jetty - Java HTTP Servlet Server 9.2.21
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://jetty.mortbay.org
-
-Software:cal10n-api 0.8.1
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://cal10.qos.ch/
-
-Software:protostuff 1.5.2
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.protostuff.io/
-
-Software:Spring Cloud Commons 1.1.0.RELEASE
-License:Apache License Version 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://www.spring.io/
-
-Software:vis 4.17.0
-License:Apache License 2.0 & The MIT License
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0 http://mit-license.org/
- * HOMEPAGE:
- * http://visjs.org/
-
-Software:Apache Tomcat 7.0.75
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://tomcat.apache.org/
-
-Software:fastjson 1.2.29
-License:Apache License 2.0
- * LICENSE:
- * http://www.apache.org/licenses/LICENSE-2.0
- * HOMEPAGE:
- * http://code.alibabatech.com/wiki/fastjson
\ No newline at end of file
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/README.md b/README.md
index 2185fb23db7..b2fbc167625 100644
--- a/README.md
+++ b/README.md
@@ -1,71 +1,116 @@
-# Java Chassis [](https://travis-ci.org/ServiceComb/java-chassis?branch=master)[](https://coveralls.io/github/ServiceComb/java-chassis?branch=master)
-[](http://search.maven.org/#search%7Cga%7C1%7Cio.servicecomb)
-[](https://www.apache.org/licenses/LICENSE-2.0.html)
+# Java Chassis [中文](README_ZH.md) [](http://search.maven.org/#search%7Cga%7C1%7Corg.apache.servicecomb) [](https://www.apache.org/licenses/LICENSE-2.0.html)
-ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
+Apache ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features.
-## Quick Start
+> If you find this project helpful, please don't forget to `star` it.
-Provider service:
+# releases
+
+| Release Train | Latest Version | Compiled JDK Version | Tested JDK Version | Open API | Notes |
+|----------------|----------------|----------------------|--------------------|----------|--------------------------|
+| Java Chassis 3 | 3.3.0 | OpenJDK 17 | OpenJDK 17 | 3.0.x | Depends on Spring Boot 3 |
+| Java Chassis 2 | 2.8.24 | OpenJDK 8 | OpenJDK 8, 11, 17 | 2.0.x | Depends on Spring 5 |
+| Java Chassis 1 | 1.3.11 | OpenJDK 8 | OpenJDK 8 | 2.0.x | End of Support |
+
+Java Chassis core dependencies
+
+| Java Chassis | Spring Boot | Vert.x | Swagger | Jackson |
+|--------------|-------------|--------|---------|---------|
+| 3.3.x | 3.4.x | 4.5.x | 2.2.x | 2.18.x |
+| 3.2.x | 3.3.x | 4.5.x | 2.2.x | 2.18.x |
+
+> NOTICE: Since Open API 3.0.x is not compatible with 2.0.x, Java Chassis 2 and Java Chassis 1 can not
+> work together with Java Chassis 3. All related consumers, providers and edge service need use Java Chassis 3 when upgrading.
+
+> NOTICE: Java Chassis 1 reached its end of support now after it's first release from 2018.
+
+# Quick Start
+
+* Define API
```java
-import io.servicecomb.*;
-@RpcSchema(schemaId = "helloworld")
-public class HelloWorldProvider implements HelloWorld {
- public String sayHello(String name) {
- return "Hello " + name;
- }
+@RequestMapping(path = "/provider")
+public interface ProviderService {
+ @GetMapping("/sayHello")
+ String sayHello(@RequestParam("name") String name);
}
```
-Consumer service:
+* Provider service
```java
-import io.servicecomb.*;
-@Component
-public class HelloWorldConsumer {
- @RpcReference(microserviceName = "pojo", schemaId = "helloworld")
- private static HelloWorld helloWorld;
-
- public static void main(String[] args) {
- helloWorld.sayHello("Tank");
- }
+@RestSchema(schemaId = "ProviderController", schemaInterface = ProviderService.class)
+public class ProviderController implements ProviderService {
+ @Override
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
}
```
-## Documentation
+* Consumer service
+```java
+@Configuration
+public class ProviderServiceConfiguration {
+ @Bean
+ public ProviderService providerService() {
+ return Invoker.createProxy("provider", "ProviderController", ProviderService.class);
+ }
+}
+```
-Project documentation is available on the [ServiceComb website][servicecomb-website].
+Invoke Provider service with RPC
+```java
+@RestSchema(schemaId = "ConsumerController", schemaInterface = ConsumerService.class)
+public class ConsumerController implements ConsumerService {
+ private ProviderService providerService;
+
+ @Autowired
+ public void setProviderService(ProviderService providerService) {
+ this.providerService = providerService;
+ }
+
+ @Override
+ public String sayHello(String name) {
+ return providerService.sayHello(name);
+ }
+}
+```
+
+Try out this example [here](https://servicecomb.apache.org/references/java-chassis/zh_CN/start/first-sample.html) .
+
+# Documentation
-[servicecomb-website]: http://servicecomb.io/
+Project documentation is available on the [ServiceComb Java Chassis Developer Guide][java-chassis-developer-guide].
-## Building
+[java-chassis-developer-guide]: https://servicecomb.apache.org/references/java-chassis/zh_CN/
-You don’t need to build from source to use Java Chassis (binaries in repo.servicecomb.io), but if you want to try out the latest and greatest, Java Chassis can be easily built with the maven. You also need JDK 1.8.
+# Building
+
+ You don’t need to build from source to use Java Chassis (binaries in apache nexus ), but if you want to try out the latest and greatest, Java Chassis can be easily built with the maven. You also need JDK 17.
mvn clean install
The first build may take a longer than expected as Maven downloads all the dependencies.
-## Automated Testing
+# Automated Testing
+
+ To build the docker image and run the integration tests with docker, you can use maven docker profile
+
+ mvn clean install -Pdocker -Pit
- To build the docker image and run the integration tests with docker, you can use maven docker profile
-
- mvn clean install -Pdocker
-
If you are using docker machine, please use the following command
-
- mvn clean install -Pdocker -Pdocker-machine
-
-## Contact
-Bugs: [issues](https://github.com/ServiceComb/java-chassis/issues)
+ mvn clean install -Pdocker -Pit -Pdocker-machine
+
+# Contact
-mailing lists: [users](https://groups.google.com/forum/#!forum/servicecomb-users) , [developers](https://groups.google.com/forum/#!forum/servicecomb-developers)
+Bugs: [issues](https://issues.apache.org/jira/browse/SCB)
+mailing list: [subscribe](mailto:dev-subscribe@servicecomb.apache.org) [dev](https://lists.apache.org/list.html?dev@servicecomb.apache.org)
-## Contributing
-See CONTRIBUTING for details on submitting patches and the contribution workflow.
+# Contributing
-## Reporting Issues
+See [CONTRIBUTING](http://servicecomb.apache.org/developers/contributing) for details on submitting patches and the contribution workflow.
-See reporting bugs for details about reporting any issues.
+# License
+Licensed under an [Apache 2.0 license](LICENSE).
diff --git a/README_ZH.md b/README_ZH.md
new file mode 100644
index 00000000000..bfae9746c2b
--- /dev/null
+++ b/README_ZH.md
@@ -0,0 +1,124 @@
+# Java Chassis | [English](README.md) [](http://search.maven.org/#search%7Cga%7C1%7Corg.apache.servicecomb) [](https://www.apache.org/licenses/LICENSE-2.0.html)
+
+Apache ServiceComb Java Chassis 给开发者提供一个快速构建微服务的JAVA SDK。它包含如下特性:
+
+* 基于Open API的契约优先(API First)开发模式,满足开发过程可管理、开发规范可验证要求。
+* 多种开发风格,REST(JAX-RS、Spring MVC)和RPC等,高效支持遗留系统迁移和新系统开发场景。
+* 多种通信协议, HTTP over Vert.x、Http Over Servlet、Highway等,满足不同场景对于性能、韧性的需求。
+* 统一一致的服务提供者、服务消费者处理链,易于扩展新功能。
+* 提供服务发现、配置管理、熔断、限流、灰度发布等开箱即用的服务治理能力。
+
+可以通过[设计选型参考](https://servicecomb.apache.org/references/java-chassis/zh_CN/start/design.html) 了解更多特性和设计原理。
+
+> 如果发现项目能帮助到您,别忘了点击右上角`star`表示鼓励。
+
+# 发布版本
+
+| 版本火车 | 最新版本 | 编译的JDK版本 | 支持的JDK版本 | Open API | 备注 |
+|----------------|--------|------------|-------------------|----------|-----------------|
+| Java Chassis 3 | 3.3.0 | OpenJDK 17 | OpenJDK 17 | 3.0.x | 依赖Spring Boot 3 |
+| Java Chassis 2 | 2.8.24 | OpenJDK 8 | OpenJDK 8, 11, 17 | 2.0.x | 依赖Spring 5 |
+| Java Chassis 1 | 1.3.11 | OpenJDK 8 | OpenJDK 8 | 2.0.x | 停止更新 |
+
+Java Chassis 的核心依赖
+
+| Java Chassis | Spring Boot | Vert.x | Swagger | Jackson |
+|--------------|-------------|--------|---------|---------|
+| 3.3.x | 3.4.x | 4.5.x | 2.2.x | 2.18.x |
+| 3.2.x | 3.3.x | 4.5.x | 2.2.x | 2.18.x |
+
+> NOTICE: Open API 3.0.x 不兼容 2.0.x, 因此Java Chassis 2、Java Chassis 1不能与Java Chassis 3共存互访. 升级Java Chassis 3, 需要将相关的消费者、提供者和边缘服务同时升级.
+
+> NOTICE: Java Chassis 1 第一个版本于2018发布,已经停止更新.
+
+# 快速开始
+
+* 定义服务契约
+
+```java
+@RequestMapping(path = "/provider")
+public interface ProviderService {
+ @GetMapping("/sayHello")
+ String sayHello(@RequestParam("name") String name);
+}
+```
+
+* 定义提供者
+
+```java
+@RestSchema(schemaId = "ProviderController", schemaInterface = ProviderService.class)
+public class ProviderController implements ProviderService {
+ @Override
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+}
+```
+
+* 定义消费者
+
+```java
+@Configuration
+public class ProviderServiceConfiguration {
+ @Bean
+ public ProviderService providerService() {
+ return Invoker.createProxy("provider", "ProviderController", ProviderService.class);
+ }
+}
+```
+
+使用RPC方式访问提供者。
+
+```java
+@RestSchema(schemaId = "ConsumerController", schemaInterface = ConsumerService.class)
+public class ConsumerController implements ConsumerService {
+ private ProviderService providerService;
+
+ @Autowired
+ public void setProviderService(ProviderService providerService) {
+ this.providerService = providerService;
+ }
+
+ @Override
+ public String sayHello(String name) {
+ return providerService.sayHello(name);
+ }
+}
+```
+
+下载并体验上述[示例项目](https://servicecomb.apache.org/references/java-chassis/zh_CN/start/first-sample.html) .
+
+# 用户文档
+
+请访问 [ServiceComb Java Chassis 开发指南][java-chassis-developer-guide].
+
+[java-chassis-developer-guide]: https://servicecomb.apache.org/references/java-chassis/zh_CN/
+
+# 编译 Java Chassis
+
+开发者可以通过MAVEN仓库使用Java Chassis。 如果需要构建项目,需要使用JDK 17版本,并预先安装maven。
+
+ mvn clean install
+
+# 运行测试用例
+
+开发者需要预先安装docker。
+
+ mvn clean install -Pdocker -Pit
+
+使用docker machine。
+
+ mvn clean install -Pdocker -Pit -Pdocker-machine
+
+# 联系我们
+
+报告缺陷: [issues](https://issues.apache.org/jira/browse/SCB)
+
+邮件列表: [subscribe](mailto:dev-subscribe@servicecomb.apache.org) [dev](https://lists.apache.org/list.html?dev@servicecomb.apache.org)
+
+# 参与代码提交
+
+参考 [如何做贡献](http://servicecomb.apache.org/cn/developers/contributing).
+
+# License
+Licensed under an [Apache 2.0 license](LICENSE).
diff --git a/ci/README.md b/ci/README.md
new file mode 100644
index 00000000000..08c14d23741
--- /dev/null
+++ b/ci/README.md
@@ -0,0 +1,25 @@
+# Java Chassis Code Checks
+
+* Compilation and Installation
+
+ see .github/workflows/maven.yml
+
+* Checkstyle
+
+ see .github/workflows/checkstyle.yml
+
+* Rat Check
+
+ see .github/workflows/rat_check.yml
+
+* Spot Bugs
+
+ see .github/workflows/spotbugs.yml
+
+* OWASP Dependency Check
+
+ `mvn verify -Powasp-dependency-check` . Very Slow, run manually.
+
+* Distribution
+
+ `mvn clean deploy -Dcheckstyle.skip -Dspotbugs.skip=true -Dmaven.javadoc.skip=true -DskipTests -Prelease -Pdistribution` . Run manually when preparing a release.
diff --git a/ci/checkstyle/checkstyle.xml b/ci/checkstyle/checkstyle.xml
new file mode 100644
index 00000000000..3813950a5c8
--- /dev/null
+++ b/ci/checkstyle/checkstyle.xml
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ci/checkstyle/suppressions.xml b/ci/checkstyle/suppressions.xml
new file mode 100644
index 00000000000..57e56d56c35
--- /dev/null
+++ b/ci/checkstyle/suppressions.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/ci/spotbugs/exclude.xml b/ci/spotbugs/exclude.xml
new file mode 100644
index 00000000000..b7c53996e85
--- /dev/null
+++ b/ci/spotbugs/exclude.xml
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clients/README.md b/clients/README.md
new file mode 100644
index 00000000000..53180a4a03b
--- /dev/null
+++ b/clients/README.md
@@ -0,0 +1,13 @@
+# About
+
+This module implements common http clients for servicecomb-service-center, servicecomb-kie and other
+3rd-party services.
+
+This module is independent on servicecomb-java-chassis, and can be used in many other projects like
+Spring Cloud, Dubbo, etc.
+
+# 关于
+
+这个模块给 servicecomb-service-center, servicecomb-kie 以及其他第三方服务实现通用的 Http Client。
+
+这个模块独立于 servicecomb-java-chassis, 可以用于 Spring Cloud, Dubbo 等项目。
diff --git a/clients/config-center-client/pom.xml b/clients/config-center-client/pom.xml
new file mode 100644
index 00000000000..e7e2fa1fc2b
--- /dev/null
+++ b/clients/config-center-client/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+ clients
+ org.apache.servicecomb
+ 3.4.0-SNAPSHOT
+
+ 4.0.0
+
+ config-center-client
+ ServiceComb::Clients::Config Center Client
+
+
+
+
+ org.apache.servicecomb
+ http-client-common
+
+
+
+ org.apache.servicecomb
+ config-clients-common
+
+
+
diff --git a/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterAddressManager.java b/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterAddressManager.java
new file mode 100644
index 00000000000..977c84ef63f
--- /dev/null
+++ b/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterAddressManager.java
@@ -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.
+ */
+
+package org.apache.servicecomb.config.center.client;
+
+import java.util.List;
+
+import org.apache.servicecomb.http.client.common.AbstractAddressManager;
+import org.apache.servicecomb.http.client.common.URLEndPoint;
+import org.apache.servicecomb.http.client.event.RefreshEndpointEvent;
+
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+public class ConfigCenterAddressManager extends AbstractAddressManager {
+
+ public ConfigCenterAddressManager(String projectName, List addresses, EventBus eventBus, String region,
+ String availableZone) {
+ super(projectName, addresses, region, availableZone);
+ eventBus.register(this);
+ }
+
+ @Override
+ protected String normalizeUri(String endpoint) {
+ String address = new URLEndPoint(endpoint).toString();
+ return formatAddress(address);
+ }
+
+ @Subscribe
+ public void onRefreshEndpointEvent(RefreshEndpointEvent event) {
+ refreshEndpoint(event, RefreshEndpointEvent.CONFIG_CENTER_NAME);
+ }
+}
diff --git a/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterClient.java b/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterClient.java
new file mode 100644
index 00000000000..8ed31a5a61b
--- /dev/null
+++ b/clients/config-center-client/src/main/java/org/apache/servicecomb/config/center/client/ConfigCenterClient.java
@@ -0,0 +1,216 @@
+/*
+ * 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.servicecomb.config.center.client;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpStatus;
+import org.apache.servicecomb.config.common.exception.OperationException;
+import org.apache.servicecomb.config.center.client.model.QueryConfigurationsRequest;
+import org.apache.servicecomb.config.center.client.model.QueryConfigurationsResponse;
+import org.apache.servicecomb.http.client.common.HttpRequest;
+import org.apache.servicecomb.http.client.common.HttpResponse;
+import org.apache.servicecomb.http.client.common.HttpTransport;
+import org.apache.servicecomb.http.client.common.HttpUtils;
+import org.apache.servicecomb.http.client.event.OperationEvents.UnAuthorizedOperationEvent;
+import org.apache.servicecomb.http.client.utils.ServiceCombServiceAvailableUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.CollectionUtils;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.google.common.eventbus.EventBus;
+
+public class ConfigCenterClient implements ConfigCenterOperation {
+ private static final Logger LOGGER = LoggerFactory.getLogger(ConfigCenterClient.class);
+
+ public static final String DEFAULT_APP_SEPARATOR = "@";
+
+ public static final String DEFAULT_SERVICE_SEPARATOR = "#";
+
+ public static final String REVISION = "revision";
+
+ public static final String APPLICATION_CONFIG = "application";
+
+ public static final String DARK_LAUNCH = "darklaunch@";
+
+ private static final String ADDRESS_CHECK_PATH = "/v3/default/configuration/health?mode=readiness";
+
+ private final HttpTransport httpTransport;
+
+ private final ConfigCenterAddressManager addressManager;
+
+ private final Map> dimensionConfigNames = new HashMap<>();
+
+ private EventBus eventBus;
+
+ public ConfigCenterClient(ConfigCenterAddressManager addressManager, HttpTransport httpTransport) {
+ this.addressManager = addressManager;
+ this.httpTransport = httpTransport;
+ }
+
+ public void setEventBus(EventBus eventBus) {
+ this.eventBus = eventBus;
+ addressManager.setEventBus(eventBus);
+ }
+
+ @Override
+ public QueryConfigurationsResponse queryConfigurations(QueryConfigurationsRequest request, String address) {
+ String dimensionsInfo = buildDimensionsInfo(request, true);
+ QueryConfigurationsResponse queryConfigurationsResponse = new QueryConfigurationsResponse();
+
+ Map configurations = new HashMap<>();
+
+ String uri = null;
+ try {
+ uri = address + "/configuration/items?dimensionsInfo="
+ + HttpUtils.encodeURLParam(dimensionsInfo) + "&revision=" + request.getRevision();
+
+ Map headers = new HashMap<>();
+ headers.put("x-environment", request.getEnvironment());
+ HttpRequest httpRequest = new HttpRequest(uri, headers, null,
+ HttpRequest.GET);
+
+ HttpResponse httpResponse = httpTransport.doRequest(httpRequest);
+ recordAndSendUnAuthorizedEvent(httpResponse, address);
+ if (httpResponse.getStatusCode() == HttpStatus.SC_OK) {
+ Map> allConfigMap = HttpUtils.deserialize(
+ httpResponse.getContent(),
+ new TypeReference