diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 4db3a243..00000000
--- a/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-root=true
-
-[*.java]
-indent_style = tab
-indent_size = 4
-continuation_indent_size = 8
-
-[*.xml]
-indent_style = tab
-indent_size = 4
-continuation_indent_size = 8
-
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
deleted file mode 100644
index 6430ceef..00000000
--- a/.github/CONTRIBUTING.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-# Contributing
-
-Spring Cloud 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 we will need you to sign the
-[Contributor License Agreement](https://cla.pivotal.io/sign/spring).
-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 of Conduct
-This project adheres to the Contributor Covenant [Code of conduct](https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-## Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- [Spring Cloud Build](https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml) project. If using IntelliJ, you can use the
- [Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546) to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, 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)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* 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](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index 0bc5ef4f..00000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,20 +0,0 @@
-
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index d3204a48..00000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: waiting-for-triage
-assignees: ''
-
----
-
-**Describe the bug**
-Please provide details of the problem, including the version of Spring Cloud that you
-are using.
-
-**Sample**
-If possible, please provide a test case or sample application that reproduces
-the problem. This makes it much easier for us to diagnose the problem and to verify that
-we have fixed it.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index b2e33c5f..00000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: waiting-for-triage
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
\ No newline at end of file
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 00000000..c96e16b6
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,53 @@
+name: Deploy Docs
+run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
+on:
+ workflow_dispatch:
+ inputs:
+ build-refname:
+ description: Enter git refname to build (e.g., 5.7.x).
+ required: false
+ push:
+ branches: docs-build
+env:
+ GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
+permissions:
+ contents: write
+jobs:
+ build:
+ if: github.repository_owner == 'spring-cloud'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 5
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - name: Set up refname build
+ if: github.event.inputs.build-refname
+ run: |
+ git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
+ export BUILD_REFNAME=${{ github.event.inputs.build-refname }}
+ echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV
+ export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")
+ echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV
+ - name: Run Antora
+ run: |
+ ./mvnw --no-transfer-progress -B antora
+ - name: Publish Docs
+ uses: rwinch/spring-doc-actions/rsync-antora-reference@httpdocs-path
+ with:
+ docs-username: ${{ secrets.DOCS_USERNAME }}
+ docs-host: ${{ secrets.DOCS_HOST }}
+ docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
+ docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ site-path: target/antora/site
+ - name: Bust Cloudflare Cache
+ uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11
+ with:
+ context-root: spring-cloud-gateway
+ cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
+ cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
deleted file mode 100644
index c269dc44..00000000
--- a/.github/workflows/maven.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Build
-
-on:
- push:
- branches: [ main, 3.1.x ]
- pull_request:
- branches: [ main, 3.1.x ]
-
-jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v3
- - name: Set up JDK
- uses: actions/setup-java@v3
- with:
- distribution: 'temurin'
- java-version: '17'
- - name: Cache local Maven repository
- uses: actions/cache@v3
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- - name: Build with Maven
- run: ./mvnw clean install -B -U -Pspring -Dmaven.test.redirectTestOutputToFile=true -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- - name: Publish Test Report
- uses: mikepenz/action-junit-report@v2
- if: always() # always run even if the previous step fails
- with:
- report_paths: '**/surefire-reports/TEST-*.xml'
diff --git a/.gitignore b/.gitignore
index 62227c8c..6be8a4a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,22 @@
-.DS_Store
-*~
-#*
-*#
-.#*
-.classpath
-.project
-.settings/
-.springBeans
target/
-bin/
-_site/
-.idea
+.settings/
+.project
+.classpath
+*.orig
+.springBeans
+.factorypath
+.sts4-cache
+.ant-targets-build.xml
+src/ant/.ant-targets-upload-dist.xml
+*.sonar4clipse*
+.DS_Store
*.iml
*.ipr
*.iws
-.factorypath
-*.log
-.shelf
-*.swp
-*.swo
-.vscode/
-.flattened-pom.xml
+/.idea/
+*.graphml
+node
+node_modules
+build
+package.json
+package-lock.json
diff --git a/.mvn/maven.config b/.mvn/maven.config
deleted file mode 100644
index a6829905..00000000
--- a/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
--P spring
diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 00000000..b901097f
--- /dev/null
+++ b/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * 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.
+ */
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "0.5.6";
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if(mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if(mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
index bf82ff01..2cc7d4a5 100644
Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 6686a643..642d572c 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,18 +1,2 @@
-# 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.9.0/apache-maven-3.9.0-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://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
diff --git a/.sdkmanrc b/.sdkmanrc
deleted file mode 100644
index 415f9083..00000000
--- a/.sdkmanrc
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable auto-env through the sdkman_auto_env config
-# Add key=value pairs of SDKs to use below
-java=17.0.1-tem
diff --git a/.settings.xml b/.settings.xml
deleted file mode 100644
index 25c049f8..00000000
--- a/.settings.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
- repo.spring.io
- ${env.CI_DEPLOY_USERNAME}
- ${env.CI_DEPLOY_PASSWORD}
-
-
-
-
-
- spring
- true
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/libs-snapshot-local
-
- true
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/libs-milestone-local
-
- false
-
-
-
-
-
-
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 20e4bd85..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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
-
- 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.
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 62589edd..00000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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
-
- 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.
diff --git a/README.adoc b/README.adoc
index 39d20fae..8e25a0ca 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,341 +1,23 @@
-////
-DO NOT EDIT THIS FILE. IT WAS GENERATED.
-Manual changes to this file will be lost when it is generated again.
-Edit the files in the src/main/asciidoc/ directory instead.
-////
+= Spring Cloud Gateway Docs Build
+You're currently viewing the Antora playbook branch.
+The playbook branch hosts the docs build that is used to build and publish the production docs site.
-image::https://github.com/spring-cloud/spring-cloud-gateway/workflows/Build/badge.svg?style=svg["Actions Status", link="https://github.com/spring-cloud/spring-cloud-gateway/actions"]
-image::https://codecov.io/gh/spring-cloud/spring-cloud-gateway/branch/main/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-gateway/branch/main"]
+The Spring Cloud Gateway reference docs are built using https://antora.org[Antora].
+This README covers how to build the docs in a software branch as well as how to build the production docs site locally.
+== Building the Site
-This project provides an API Gateway built on top of the Spring Ecosystem, including: Spring 6, Spring Boot 3 and Project Reactor. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs and provide cross cutting concerns to them such as: security, monitoring/metrics, and resiliency.
-
-
-== Features
-
-* Java 17
-* Spring Framework 6
-* Spring Boot 3
-* Dynamic routing
-* Route matching built into Spring Handler Mapping
-* Route matching on HTTP Request (Path, Method, Header, Host, etc...)
-* Filters scoped to Matching Route
-* Filters can modify downstream HTTP Request and HTTP Response (Add/Remove Headers, Add/Remove Parameters, Rewrite Path, Set Path, Hystrix, etc...)
-* API or configuration driven
-* Supports Spring Cloud `DiscoveryClient` for configuring Routes
-
-== Building
-
-:jdkversion: 17
-
-=== Basic Compile and Test
-
-To build the source you will need to install JDK {jdkversion}.
-
-Spring Cloud uses Maven for most build-related activities, and you
-should be able to get off the ground quite quickly by cloning the
-project you are interested in and typing
+You can build the entire site by invoking the following on the docs-build branch and then viewing the site at `target/site/index.html`
+[source,bash]
----
-$ ./mvnw install
+./mvnw antora
----
-NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
-in place of `./mvnw` in the examples below. If you do that you also
-might need to add `-P spring` if your local Maven settings do not
-contain repository declarations for spring pre-release artifacts.
+== Building a Specific Branch
-NOTE: Be aware that you might need to increase the amount of memory
-available to Maven by setting a `MAVEN_OPTS` environment variable with
-a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
-the `.mvn` configuration, so if you find you have to do it to make a
-build succeed, please raise a ticket to get the settings added to
-source control.
-
-The projects that require middleware (i.e. Redis) for testing generally
-require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.
-
-
-=== Documentation
-
-The spring-cloud-build module has a "docs" profile, and if you switch
-that on it will try to build asciidoc sources from
-`src/main/asciidoc`. As part of that process it will look for a
-`README.adoc` and process it by loading all the includes, but not
-parsing or rendering it, just copying it to `${main.basedir}`
-(defaults to `${basedir}`, i.e. the root of the project). If there are
-any changes in the README it will then show up after a Maven build as
-a modified file in the correct place. Just commit it and push the change.
-
-=== Working with the code
-If you don't have an IDE preference we would recommend that you use
-https://www.springsource.com/developer/sts[Spring Tools Suite] or
-https://eclipse.org[Eclipse] when working with the code. We use the
-https://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
-should also work without issue as long as they use Maven 3.3.3 or better.
-
-==== Activate the Spring Maven profile
-Spring Cloud projects require the 'spring' Maven profile to be activated to resolve
-the spring milestone and snapshot repositories. Use your preferred IDE to set this
-profile to be active, or you may experience build errors.
-
-==== Importing into eclipse with m2eclipse
-We recommend the https://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
-eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
-marketplace".
-
-NOTE: Older versions of m2e do not support Maven 3.3, so once the
-projects are imported into Eclipse you will also need to tell
-m2eclipse to use the right profile for the projects. If you
-see many different errors related to the POMs in the projects, check
-that you have an up to date installation. If you can't upgrade m2e,
-add the "spring" profile to your `settings.xml`. Alternatively you can
-copy the repository settings from the "spring" profile of the parent
-pom into your `settings.xml`.
-
-==== Importing into eclipse without m2eclipse
-If you prefer not to use m2eclipse you can generate eclipse project metadata using the
-following command:
-
-[indent=0]
+[source,bash]
----
- $ ./mvnw eclipse:eclipse
+./mvnw antora
----
-
-The generated eclipse projects can be imported by selecting `import existing projects`
-from the `file` menu.
-
-
-== Contributing
-
-:spring-cloud-build-branch: master
-
-Spring Cloud 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 we will need you to sign the
-https://cla.pivotal.io/sign/spring[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 of Conduct
-This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
-conduct]. By participating, you are expected to uphold this code. Please report
-unacceptable behavior to spring-code-of-conduct@pivotal.io.
-
-=== Code Conventions and Housekeeping
-None of these is essential for a pull request, but they will all help. They can also be
-added after the original pull request but before a merge.
-
-* Use the Spring Framework code format conventions. If you use Eclipse
- you can import formatter settings using the
- `eclipse-code-formatter.xml` file from the
- https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
- Cloud Build] project. If using IntelliJ, you can use the
- https://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
- Plugin] to import the same file.
-* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
- `@author` tag identifying you, 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)
-* Add yourself as an `@author` to the .java files that you modify substantially (more
- than cosmetic changes).
-* Add some Javadocs and, if you change the namespace, some XSD doc elements.
-* A few unit tests would help a lot as well -- someone has to do it.
-* 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 https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
- if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
- message (where XXXX is the issue number).
-
-=== Checkstyle
-
-Spring Cloud Build comes with a set of checkstyle rules. You can find them in the `spring-cloud-build-tools` module. The most notable files under the module are:
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- └── checkstyle.xml <1>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-
-==== Checkstyle configuration
-
-Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins.
-
-.pom.xml
-----
-
-true <1>
- true
- <2>
- true
- <3>
-
-
-
-
- <4>
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-
- <5>
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
-
-
-
-----
-<1> Fails the build upon Checkstyle errors
-<2> Fails the build upon Checkstyle violations
-<3> Checkstyle analyzes also the test sources
-<4> Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules
-<5> Add checkstyle plugin to your build and reporting phases
-
-If you need to suppress some rules (e.g. line length needs to be longer), then it's enough for you to define a file under `${project.root}/src/checkstyle/checkstyle-suppressions.xml` with your suppressions. Example:
-
-.projectRoot/src/checkstyle/checkstyle-suppresions.xml
-----
-
-
-
-
-
-
-----
-
-It's advisable to copy the `${spring-cloud-build.rootFolder}/.editorconfig` and `${spring-cloud-build.rootFolder}/.springformat` to your project. That way, some default formatting rules will be applied. You can do so by running this script:
-
-```bash
-$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat
-```
-
-=== IDE setup
-
-==== Intellij IDEA
-
-In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.
-The following files can be found in the https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools[Spring Cloud Build] project.
-
-.spring-cloud-build-tools/
-----
-└── src
- ├── checkstyle
- │ └── checkstyle-suppressions.xml <3>
- └── main
- └── resources
- ├── checkstyle-header.txt <2>
- ├── checkstyle.xml <1>
- └── intellij
- ├── Intellij_Project_Defaults.xml <4>
- └── Intellij_Spring_Boot_Java_Conventions.xml <5>
-----
-<1> Default Checkstyle rules
-<2> File header setup
-<3> Default suppression rules
-<4> Project defaults for Intellij that apply most of Checkstyle rules
-<5> Project style conventions for Intellij that apply most of Checkstyle rules
-
-.Code style
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-code-style.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Code style`. There click on the icon next to the `Scheme` section. There, click on the `Import Scheme` value and pick the `Intellij IDEA code style XML` option. Import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml` file.
-
-.Inspection profiles
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-inspections.png[Code style]
-
-Go to `File` -> `Settings` -> `Editor` -> `Inspections`. There click on the icon next to the `Profile` section. There, click on the `Import Profile` and import the `spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml` file.
-
-.Checkstyle
-
-To have Intellij work with Checkstyle, you have to install the `Checkstyle` plugin. It's advisable to also install the `Assertions2Assertj` to automatically convert the JUnit assertions
-
-image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/{spring-cloud-build-branch}/docs/src/main/asciidoc/images/intellij-checkstyle.png[Checkstyle]
-
-Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on the `+` icon in the `Configuration file` section. There, you'll have to define where the checkstyle rules should be picked from. In the image above, we've picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build's GitHub repository (e.g. for the `checkstyle.xml` : `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml`). We need to provide the following variables:
-
-- `checkstyle.header.file` - please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt` URL.
-- `checkstyle.suppressions.file` - default suppressions. Please point it to the Spring Cloud Build's, `spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` file either in your cloned repo or via the `https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml` URL.
-- `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`.
-
-IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources.
-
-=== Duplicate Finder
-
-Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath.
-
-==== Duplicate Finder configuration
-
-Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`.
-
-.pom.xml
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
-
-----
-
-For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation].
-
-You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build.
-
-If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project:
-
-[source,xml]
-----
-
-
-
- org.basepom.maven
- duplicate-finder-maven-plugin
-
-
- org.joda.time.base.BaseDateTime
- .*module-info
-
-
- changelog.txt
-
-
-
-
-
-
-
-----
-
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index 04685956..00000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Security Policy
-
-## Reporting a Vulnerability
-
-To report security vulnerabilities, please go to https://pivotal.io/security.
diff --git a/antora-playbook.yml b/antora-playbook.yml
new file mode 100644
index 00000000..7cc4071c
--- /dev/null
+++ b/antora-playbook.yml
@@ -0,0 +1,44 @@
+antora:
+ extensions:
+ - '@springio/antora-extensions/partial-build-extension'
+ - require: '@springio/antora-extensions/latest-version-extension'
+ - require: '@springio/antora-extensions/inject-collector-cache-config-extension'
+ - '@antora/collector-extension'
+ - '@antora/atlas-extension'
+ - require: '@springio/antora-extensions/root-component-extension'
+ root_component_name: 'cloud-gateway'
+site:
+ title: Spring Cloud Gateway
+ url: https://docs.spring.io/spring-cloud-gateway/reference
+ robots: allow
+git:
+ ensure_git_suffix: false
+content:
+ sources:
+ - url: https://github.com/spring-cloud/spring-cloud-gateway
+ # Refname matching:
+ # https://docs.antora.org/antora/latest/playbook/content-refname-matching/
+ branches: [ main ]
+ tags: [ '({4..9}).+({1..9}).+({0..9})?(-{RC,M}+({0..9}))', '!4.1.0-M1' ]
+ start_path: docs
+asciidoc:
+ attributes:
+ page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud
+ page-pagination: ''
+ hide-uri-scheme: '@'
+ tabs-sync-option: '@'
+ extensions:
+ - '@asciidoctor/tabs'
+ - '@springio/asciidoctor-extensions'
+urls:
+ latest_version_segment_strategy: redirect:to
+ latest_version_segment: ''
+ redirect_facility: httpd
+ui:
+ bundle:
+ url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
+ snapshot: true
+runtime:
+ log:
+ failure_level: warn
+ format: pretty
diff --git a/docs/src/main/asciidoc/README.adoc b/docs/modules/ROOT/pages/README.adoc
similarity index 100%
rename from docs/src/main/asciidoc/README.adoc
rename to docs/modules/ROOT/pages/README.adoc
diff --git a/docs/src/main/asciidoc/_attributes.adoc b/docs/modules/ROOT/pages/_attributes.adoc
similarity index 100%
rename from docs/src/main/asciidoc/_attributes.adoc
rename to docs/modules/ROOT/pages/_attributes.adoc
diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/modules/ROOT/pages/_configprops.adoc
similarity index 100%
rename from docs/src/main/asciidoc/_configprops.adoc
rename to docs/modules/ROOT/pages/_configprops.adoc
diff --git a/docs/src/main/asciidoc/appendix.adoc b/docs/modules/ROOT/pages/appendix.adoc
similarity index 100%
rename from docs/src/main/asciidoc/appendix.adoc
rename to docs/modules/ROOT/pages/appendix.adoc
diff --git a/docs/src/main/asciidoc/index.adoc b/docs/modules/ROOT/pages/index.adoc
similarity index 100%
rename from docs/src/main/asciidoc/index.adoc
rename to docs/modules/ROOT/pages/index.adoc
diff --git a/docs/src/main/asciidoc/intro.adoc b/docs/modules/ROOT/pages/intro.adoc
similarity index 100%
rename from docs/src/main/asciidoc/intro.adoc
rename to docs/modules/ROOT/pages/intro.adoc
diff --git a/docs/src/main/asciidoc/sagan-boot.adoc b/docs/modules/ROOT/pages/sagan-boot.adoc
similarity index 100%
rename from docs/src/main/asciidoc/sagan-boot.adoc
rename to docs/modules/ROOT/pages/sagan-boot.adoc
diff --git a/docs/src/main/asciidoc/sagan-index.adoc b/docs/modules/ROOT/pages/sagan-index.adoc
similarity index 100%
rename from docs/src/main/asciidoc/sagan-index.adoc
rename to docs/modules/ROOT/pages/sagan-index.adoc
diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/modules/ROOT/pages/spring-cloud-gateway.adoc
similarity index 100%
rename from docs/src/main/asciidoc/spring-cloud-gateway.adoc
rename to docs/modules/ROOT/pages/spring-cloud-gateway.adoc
diff --git a/docs/pom.xml b/docs/pom.xml
deleted file mode 100644
index aefdaea7..00000000
--- a/docs/pom.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.cloud
- spring-cloud-gateway
- 4.1.0-SNAPSHOT
-
- spring-cloud-gateway-docs
- jar
- Spring Cloud Gateway Docs
- Spring Cloud Docs
-
- spring-cloud-gateway
- ${basedir}/..
- spring.cloud.gateway.*
- deploy
-
- none
-
-
- 1.0.0
- ${maven.multiModuleProjectDirectory}/spring-cloud-gateway-server/
- .*
- ${maven.multiModuleProjectDirectory}/docs/target/observability/
-
-
-
- ${project.groupId}
- spring-cloud-starter-gateway
-
-
-
- src/main/asciidoc
-
-
-
- docs
-
-
-
- pl.project13.maven
- git-commit-id-plugin
-
-
- org.codehaus.mojo
- exec-maven-plugin
-
-
- generate-docs
- prepare-package
-
- java
-
-
- io.micrometer.docs.DocsGeneratorCommand
- true
-
- ${micrometer-docs-generator.inputPath}
- ${micrometer-docs-generator.inclusionPattern}
- ${micrometer-docs-generator.outputPath}
-
-
-
-
-
-
- io.micrometer
- micrometer-docs-generator
- ${micrometer-docs-generator.version}
- jar
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- org.apache.maven.plugins
- maven-resources-plugin
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
-
-
- maven-deploy-plugin
-
-
-
-
-
-
diff --git a/docs/src/main/asciidoc/gateway-grafana-dashboard.json b/docs/src/main/asciidoc/gateway-grafana-dashboard.json
deleted file mode 100644
index ea479bdb..00000000
--- a/docs/src/main/asciidoc/gateway-grafana-dashboard.json
+++ /dev/null
@@ -1,2068 +0,0 @@
-{
- "__inputs": [
- {
- "name": "DS_PROMETHEUS",
- "label": "prometheus",
- "description": "",
- "type": "datasource",
- "pluginId": "prometheus",
- "pluginName": "Prometheus"
- }
- ],
- "__requires": [
- {
- "type": "grafana",
- "id": "grafana",
- "name": "Grafana",
- "version": "5.0.0"
- },
- {
- "type": "panel",
- "id": "graph",
- "name": "Graph",
- "version": "5.0.0"
- },
- {
- "type": "datasource",
- "id": "prometheus",
- "name": "Prometheus",
- "version": "5.0.0"
- }
- ],
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": "-- Grafana --",
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "gnetId": null,
- "graphTooltip": 0,
- "id": null,
- "iteration": 1550777954006,
- "links": [],
- "panels": [
- {
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 50,
- "panels": [
- {
- "cacheTimeout": null,
- "colorBackground": false,
- "colorValue": false,
- "colors": [
- "rgba(245, 54, 54, 0.9)",
- "rgba(191, 148, 112, 0.89)",
- "rgba(50, 172, 45, 0.97)"
- ],
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "format": "none",
- "gauge": {
- "maxValue": 100,
- "minValue": 0,
- "show": false,
- "thresholdLabels": false,
- "thresholdMarkers": true
- },
- "gridPos": {
- "h": 3,
- "w": 8,
- "x": 0,
- "y": 2
- },
- "hideTimeOverride": false,
- "id": 28,
- "interval": null,
- "links": [],
- "mappingType": 1,
- "mappingTypes": [
- {
- "name": "value to text",
- "value": 1
- },
- {
- "name": "range to text",
- "value": 2
- }
- ],
- "maxDataPoints": 100,
- "nullPointMode": "connected",
- "nullText": null,
- "postfix": "",
- "postfixFontSize": "50%",
- "prefix": "",
- "prefixFontSize": "50%",
- "rangeMaps": [
- {
- "from": "null",
- "text": "N/A",
- "to": "null"
- }
- ],
- "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)",
- "full": false,
- "lineColor": "rgb(31, 120, 193)",
- "show": false
- },
- "tableColumn": "Value",
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{job=~\"$gatewayService\"})",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 1200
- }
- ],
- "thresholds": "",
- "timeFrom": null,
- "timeShift": null,
- "title": "Total Requests Served",
- "type": "singlestat",
- "valueFontSize": "80%",
- "valueMaps": [
- {
- "op": "=",
- "text": "N/A",
- "value": "null"
- }
- ],
- "valueName": "current"
- },
- {
- "cacheTimeout": null,
- "colorBackground": false,
- "colorValue": false,
- "colors": [
- "rgba(245, 54, 54, 0.9)",
- "rgba(191, 148, 112, 0.89)",
- "rgba(50, 172, 45, 0.97)"
- ],
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "format": "none",
- "gauge": {
- "maxValue": 100,
- "minValue": 0,
- "show": false,
- "thresholdLabels": false,
- "thresholdMarkers": true
- },
- "gridPos": {
- "h": 3,
- "w": 8,
- "x": 8,
- "y": 2
- },
- "hideTimeOverride": false,
- "id": 29,
- "interval": null,
- "links": [],
- "mappingType": 1,
- "mappingTypes": [
- {
- "name": "value to text",
- "value": 1
- },
- {
- "name": "range to text",
- "value": 2
- }
- ],
- "maxDataPoints": 100,
- "nullPointMode": "connected",
- "nullText": null,
- "postfix": "",
- "postfixFontSize": "50%",
- "prefix": "",
- "prefixFontSize": "50%",
- "rangeMaps": [
- {
- "from": "null",
- "text": "N/A",
- "to": "null"
- }
- ],
- "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)",
- "full": false,
- "lineColor": "rgb(31, 120, 193)",
- "show": false
- },
- "tableColumn": "Value",
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{outcome=\"SUCCESSFUL\", job=~\"$gatewayService\"})",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 1200
- }
- ],
- "thresholds": "",
- "timeFrom": null,
- "timeShift": null,
- "title": "Total Successful Requests Served",
- "type": "singlestat",
- "valueFontSize": "80%",
- "valueMaps": [
- {
- "op": "=",
- "text": "N/A",
- "value": "null"
- }
- ],
- "valueName": "current"
- },
- {
- "cacheTimeout": null,
- "colorBackground": false,
- "colorValue": false,
- "colors": [
- "rgba(245, 54, 54, 0.9)",
- "rgba(191, 148, 112, 0.89)",
- "rgba(50, 172, 45, 0.97)"
- ],
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "format": "none",
- "gauge": {
- "maxValue": 100,
- "minValue": 0,
- "show": false,
- "thresholdLabels": false,
- "thresholdMarkers": true
- },
- "gridPos": {
- "h": 3,
- "w": 8,
- "x": 16,
- "y": 2
- },
- "hideTimeOverride": false,
- "id": 30,
- "interval": null,
- "links": [],
- "mappingType": 1,
- "mappingTypes": [
- {
- "name": "value to text",
- "value": 1
- },
- {
- "name": "range to text",
- "value": 2
- }
- ],
- "maxDataPoints": 100,
- "nullPointMode": "connected",
- "nullText": null,
- "postfix": "",
- "postfixFontSize": "50%",
- "prefix": "",
- "prefixFontSize": "50%",
- "rangeMaps": [
- {
- "from": "null",
- "text": "N/A",
- "to": "null"
- }
- ],
- "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)",
- "full": false,
- "lineColor": "rgb(31, 120, 193)",
- "show": false
- },
- "tableColumn": "Value",
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{outcome!=\"SUCCESSFUL\", job=~\"$gatewayService\"})",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 1200
- }
- ],
- "thresholds": "",
- "timeFrom": null,
- "timeShift": null,
- "title": "Total Unsuccessful Requests Served",
- "type": "singlestat",
- "valueFontSize": "80%",
- "valueMaps": [
- {
- "op": "=",
- "text": "N/A",
- "value": "null"
- }
- ],
- "valueName": "current"
- }
- ],
- "repeat": null,
- "title": "Total Throughput",
- "type": "row"
- },
- {
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 1
- },
- "id": 51,
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 0,
- "y": 3
- },
- "id": 49,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": "routeId",
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "ms-test",
- "value": "ms-test"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_sum{routeId=~\"$routeId\", job=~\"$gatewayService\"}/spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ status }}",
- "metric": "gateway_api_time_seconds_sum",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "s",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 6,
- "y": 3
- },
- "id": 70,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 49,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext",
- "value": "msnext"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_sum{routeId=~\"$routeId\", job=~\"$gatewayService\"}/spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ status }}",
- "metric": "gateway_api_time_seconds_sum",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "s",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 12,
- "y": 3
- },
- "id": 71,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 49,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-a3s",
- "value": "msnext-a3s"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_sum{routeId=~\"$routeId\", job=~\"$gatewayService\"}/spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ status }}",
- "metric": "gateway_api_time_seconds_sum",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "s",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 18,
- "y": 3
- },
- "id": 72,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 49,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-sample",
- "value": "msnext-sample"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_sum{routeId=~\"$routeId\", job=~\"$gatewayService\"}/spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ status }}",
- "metric": "gateway_api_time_seconds_sum",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "s",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- }
- ],
- "repeat": null,
- "title": "Request Processing Time",
- "type": "row"
- },
- {
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 2
- },
- "id": 52,
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 2,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "minSpan": null,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": "routeId",
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "ms-test",
- "value": "ms-test"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": true,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_count{outcome=\"SUCCESSFUL\", routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ routeUri }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId Success API Gateway Calls",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "cumulative"
- },
- "transparent": false,
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 6,
- "y": 4
- },
- "id": 73,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "minSpan": null,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 2,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext",
- "value": "msnext"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": true,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_count{outcome=\"SUCCESSFUL\", routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ routeUri }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId Success API Gateway Calls",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "cumulative"
- },
- "transparent": false,
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 12,
- "y": 4
- },
- "id": 74,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "minSpan": null,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 2,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-a3s",
- "value": "msnext-a3s"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": true,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_count{outcome=\"SUCCESSFUL\", routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ routeUri }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId Success API Gateway Calls",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "cumulative"
- },
- "transparent": false,
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 75,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "minSpan": null,
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550777954005,
- "repeatPanelId": 2,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-sample",
- "value": "msnext-sample"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": true,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_count{outcome=\"SUCCESSFUL\", routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ routeUri }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId Success API Gateway Calls",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "cumulative"
- },
- "transparent": false,
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- }
- ],
- "repeat": null,
- "title": "Successful API Calls",
- "type": "row"
- },
- {
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 3
- },
- "id": 53,
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 8,
- "x": 0,
- "y": 14
- },
- "id": 3,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": "routeId",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": true,
- "steppedLine": false,
- "targets": [
- {
- "expr": "spring_cloud_gateway_requests_seconds_count{outcome!=\"SUCCESSFUL\", routeId=~\"$routeId\", job=~\"$gatewayService\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ routeUri }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId Unsuccessful GW Calls",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "cumulative"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- }
- ],
- "repeat": null,
- "title": "Unsuccessful API Calls",
- "type": "row"
- },
- {
- "collapsed": true,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 4
- },
- "id": 54,
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 0,
- "y": 15
- },
- "id": 35,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": "routeId",
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "ms-test",
- "value": "ms-test"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}) by (job, status)",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ status }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 6,
- "y": 15
- },
- "id": 58,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550775166360,
- "repeatPanelId": 35,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext",
- "value": "msnext"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}) by (job, status)",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ status }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 12,
- "y": 15
- },
- "id": 59,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550775166360,
- "repeatPanelId": 35,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-a3s",
- "value": "msnext-a3s"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}) by (job, status)",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ status }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "description": "",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 6,
- "x": 18,
- "y": 15
- },
- "id": 60,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "repeat": null,
- "repeatIteration": 1550775166360,
- "repeatPanelId": 35,
- "scopedVars": {
- "routeId": {
- "selected": false,
- "text": "msnext-sample",
- "value": "msnext-sample"
- }
- },
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(spring_cloud_gateway_requests_seconds_count{routeId=~\"$routeId\", job=~\"$gatewayService\"}) by (job, status)",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "{{ job }} / {{ status }}",
- "metric": "spring_cloud_gateway_requests_seconds_count",
- "refId": "A",
- "step": 240
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "$routeId",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- }
- ],
- "repeat": null,
- "title": "API / HTTP Status",
- "type": "row"
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 5
- },
- "id": 64,
- "panels": [],
- "title": "JVM",
- "type": "row"
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 6
- },
- "id": 62,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "process_cpu_usage{job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 1,
- "legendFormat": "{{ instance }}",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "CPU Usage",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 6
- },
- "id": 69,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(jvm_memory_used_bytes{job=~\"$gatewayService\"}) by (job, instance)",
- "format": "time_series",
- "hide": false,
- "interval": "",
- "intervalFactor": 1,
- "legendFormat": "{{ instance }}",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "Memory Used",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 6
- },
- "id": 77,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "jvm_threads_live_threads{job=~\"$gatewayService\"}",
- "format": "time_series",
- "hide": false,
- "intervalFactor": 1,
- "legendFormat": "{{ instance }}",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeShift": null,
- "title": "Live Threads",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- },
- {
- "alert": {
- "conditions": [
- {
- "evaluator": {
- "params": [
- 0.3
- ],
- "type": "gt"
- },
- "operator": {
- "type": "and"
- },
- "query": {
- "params": [
- "A",
- "5m",
- "now"
- ]
- },
- "reducer": {
- "params": [],
- "type": "avg"
- },
- "type": "query"
- }
- ],
- "executionErrorState": "alerting",
- "frequency": "60s",
- "handler": 1,
- "name": "Memory Saturation alert",
- "noDataState": "no_data",
- "notifications": []
- },
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "datasource": "${DS_PROMETHEUS}",
- "fill": 1,
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 6
- },
- "id": 79,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 5,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "jvm_gc_memory_promoted_bytes_total/jvm_gc_memory_allocated_bytes_total",
- "format": "time_series",
- "hide": false,
- "intervalFactor": 1,
- "legendFormat": "{{ instance }}",
- "refId": "A"
- }
- ],
- "thresholds": [
- {
- "colorMode": "critical",
- "fill": true,
- "line": true,
- "op": "gt",
- "value": 0.3
- }
- ],
- "timeFrom": null,
- "timeShift": null,
- "title": "Memory Saturation",
- "tooltip": {
- "shared": false,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ]
- }
- ],
- "refresh": "1m",
- "schemaVersion": 16,
- "style": "dark",
- "tags": [],
- "templating": {
- "list": [
- {
- "allValue": null,
- "current": {},
- "datasource": "${DS_PROMETHEUS}",
- "hide": 0,
- "includeAll": true,
- "label": "Gateway Service",
- "multi": true,
- "name": "gatewayService",
- "options": [],
- "query": "label_values(spring_cloud_gateway_requests_seconds_count,job)",
- "refresh": 1,
- "regex": "",
- "sort": 1,
- "tagValuesQuery": "",
- "tags": [],
- "tagsQuery": "",
- "type": "query",
- "useTags": false
- },
- {
- "allValue": null,
- "current": {},
- "datasource": "${DS_PROMETHEUS}",
- "hide": 0,
- "includeAll": true,
- "label": "Route Id",
- "multi": true,
- "name": "routeId",
- "options": [],
- "query": "label_values(spring_cloud_gateway_requests_seconds_count,routeId)",
- "refresh": 1,
- "regex": "",
- "sort": 1,
- "tagValuesQuery": "",
- "tags": [],
- "tagsQuery": "",
- "type": "query",
- "useTags": false
- }
- ]
- },
- "time": {
- "from": "now/d",
- "to": "now"
- },
- "timepicker": {
- "refresh_intervals": [
- "5s",
- "10s",
- "30s",
- "1m",
- "5m",
- "15m",
- "30m",
- "1h",
- "2h",
- "1d"
- ],
- "time_options": [
- "5m",
- "15m",
- "1h",
- "6h",
- "12h",
- "24h",
- "2d",
- "7d",
- "30d"
- ]
- },
- "timezone": "",
- "title": "Spring Cloud Gateway",
- "uid": "7voUGKrik",
- "version": 5
-}
diff --git a/docs/src/main/asciidoc/ghpages.sh b/docs/src/main/asciidoc/ghpages.sh
deleted file mode 100755
index 55e76be1..00000000
--- a/docs/src/main/asciidoc/ghpages.sh
+++ /dev/null
@@ -1,330 +0,0 @@
-#!/bin/bash -x
-
-set -e
-
-# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
-function set_default_props() {
- # The script should be executed from the root folder
- ROOT_FOLDER=`pwd`
- echo "Current folder is ${ROOT_FOLDER}"
-
- if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
- echo "You're not in the root folder of the project!"
- exit 1
- fi
-
- # Prop that will let commit the changes
- COMMIT_CHANGES="no"
- MAVEN_PATH=${MAVEN_PATH:-}
- echo "Path to Maven is [${MAVEN_PATH}]"
- REPO_NAME=${PWD##*/}
- echo "Repo name is [${REPO_NAME}]"
- SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
- echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
-}
-
-# Check if gh-pages exists and docs have been built
-function check_if_anything_to_sync() {
- git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
-
- if ! (git remote set-branches --add origin gh-pages && git fetch -q); then
- echo "No gh-pages, so not syncing"
- exit 0
- fi
-
- if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
- echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
- exit 0
- fi
-}
-
-function retrieve_current_branch() {
- # Code getting the name of the current branch. For master we want to publish as we did until now
- # https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
- # If there is a branch already passed will reuse it - otherwise will try to find it
- CURRENT_BRANCH=${BRANCH}
- if [[ -z "${CURRENT_BRANCH}" ]] ; then
- CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
- CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
- CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
- fi
- echo "Current branch is [${CURRENT_BRANCH}]"
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
-}
-
-# Switches to the provided value of the release version. We always prefix it with `v`
-function switch_to_tag() {
- git checkout v${VERSION}
-}
-
-# Build the docs if switch is on
-function build_docs_if_applicable() {
- if [[ "${BUILD}" == "yes" ]] ; then
- ./mvnw clean install -P docs -pl docs -DskipTests
- fi
-}
-
-# Get the name of the `docs.main` property
-# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
-function retrieve_doc_properties() {
- MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args='${docs.main}' \
- --non-recursive \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
-
-
- WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
- WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
- -Dexec.executable="echo" \
- -Dexec.args="\${${WHITELIST_PROPERTY}}" \
- org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
- -P docs \
- -pl docs)
- echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
-}
-
-# Stash any outstanding changes
-function stash_changes() {
- git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
- if [ "$dirty" != "0" ]; then git stash; fi
-}
-
-# Switch to gh-pages branch to sync it with current branch
-function add_docs_from_target() {
- local DESTINATION_REPO_FOLDER
- if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
- DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
- elif [[ "${CLONE}" == "yes" ]]; then
- mkdir -p ${ROOT_FOLDER}/target
- local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
- if [[ ! -e "${clonedStatic}/.git" ]]; then
- echo "Cloning Spring Cloud Static to target"
- git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && git checkout gh-pages
- else
- echo "Spring Cloud Static already cloned - will pull changes"
- cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
- fi
- DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- else
- if [[ ! -e "${DESTINATION}/.git" ]]; then
- echo "[${DESTINATION}] is not a git repository"
- exit 1
- fi
- DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
- mkdir -p ${DESTINATION_REPO_FOLDER}
- echo "Destination was provided [${DESTINATION}]"
- fi
- cd ${DESTINATION_REPO_FOLDER}
- git checkout gh-pages
- git pull origin gh-pages
-
- # Add git branches
- ###################################################################
- if [[ -z "${VERSION}" ]] ; then
- copy_docs_for_current_version
- else
- copy_docs_for_provided_version
- fi
- commit_changes_if_applicable
-}
-
-
-# Copies the docs by using the retrieved properties from Maven build
-function copy_docs_for_current_version() {
- if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
- echo -e "Current branch is master - will copy the current docs only to the root folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- cp -rf $f ${ROOT_FOLDER}/
- git add -A ${ROOT_FOLDER}/$file
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Current branch is [${CURRENT_BRANCH}]"
- # https://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
- if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
- mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
- echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
- for f in docs/target/generated-docs/*; do
- file=${f#docs/target/generated-docs/*}
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
- # Not ignored...
- # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
- else
- cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
- git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
- fi
- fi
- done
- COMMIT_CHANGES="yes"
- else
- echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
- [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
- fi
- fi
-}
-
-# Copies the docs by using the explicitly provided version
-function copy_docs_for_provided_version() {
- local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
- mkdir -p ${FOLDER}
- echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
- for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
- file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
- copy_docs_for_branch ${file} ${FOLDER}
- done
- COMMIT_CHANGES="yes"
- CURRENT_BRANCH="v${VERSION}"
-}
-
-# Copies the docs from target to the provided destination
-# Params:
-# $1 - file from target
-# $2 - destination to which copy the files
-function copy_docs_for_branch() {
- local file=$1
- local destination=$2
- if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
- # Not ignored...
- # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
- if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
- # We don't want to copy the spring-cloud-sleuth.html
- # we want it to be converted to index.html
- cp -rf $f ${destination}/index.html
- git add -A ${destination}/index.html
- else
- cp -rf $f ${destination}
- git add -A ${destination}/$file
- fi
- fi
-}
-
-function commit_changes_if_applicable() {
- if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
- COMMIT_SUCCESSFUL="no"
- git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
-
- # Uncomment the following push if you want to auto push to
- # the gh-pages branch whenever you commit to master locally.
- # This is a little extreme. Use with care!
- ###################################################################
- if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
- git push origin gh-pages
- fi
- fi
-}
-
-# Switch back to the previous branch and exit block
-function checkout_previous_branch() {
- # If -version was provided we need to come back to root project
- cd ${ROOT_FOLDER}
- git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
- if [ "$dirty" != "0" ]; then git stash pop; fi
- exit 0
-}
-
-# Assert if properties have been properly passed
-function assert_properties() {
-echo "VERSION [${VERSION}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
-if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
-if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
-if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
-}
-
-# Prints the usage
-function print_usage() {
-cat </`
-- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
- switch to gh-pages of that repo and copy the generated docs to `docs//`
-
-USAGE:
-
-You can use the following options:
-
--v|--version - the script will apply the whole procedure for a particular library version
--d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
- E.g. point to spring-cloud-static folder. Can't be used with (-c)
--b|--build - will run the standard build process after checking out the branch
--c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
- Obviously can't be used with (-d)
-
-EOF
-}
-
-
-# ==========================================
-# ____ ____ _____ _____ _____ _______
-# / ____|/ ____| __ \|_ _| __ \__ __|
-# | (___ | | | |__) | | | | |__) | | |
-# \___ \| | | _ / | | | ___/ | |
-# ____) | |____| | \ \ _| |_| | | |
-# |_____/ \_____|_| \_\_____|_| |_|
-#
-# ==========================================
-
-while [[ $# > 0 ]]
-do
-key="$1"
-case ${key} in
- -v|--version)
- VERSION="$2"
- shift # past argument
- ;;
- -d|--destination)
- DESTINATION="$2"
- shift # past argument
- ;;
- -b|--build)
- BUILD="yes"
- ;;
- -c|--clone)
- CLONE="yes"
- ;;
- -h|--help)
- print_usage
- exit 0
- ;;
- *)
- echo "Invalid option: [$1]"
- print_usage
- exit 1
- ;;
-esac
-shift # past argument or value
-done
-
-assert_properties
-set_default_props
-check_if_anything_to_sync
-if [[ -z "${VERSION}" ]] ; then
- retrieve_current_branch
-else
- switch_to_tag
-fi
-build_docs_if_applicable
-retrieve_doc_properties
-stash_changes
-add_docs_from_target
-checkout_previous_branch
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/images/gateway-grafana-dashboard.jpeg b/docs/src/main/asciidoc/images/gateway-grafana-dashboard.jpeg
deleted file mode 100644
index 3a231f70..00000000
Binary files a/docs/src/main/asciidoc/images/gateway-grafana-dashboard.jpeg and /dev/null differ
diff --git a/docs/src/main/asciidoc/images/spring_cloud_gateway_diagram.png b/docs/src/main/asciidoc/images/spring_cloud_gateway_diagram.png
deleted file mode 100644
index 25ffbcce..00000000
Binary files a/docs/src/main/asciidoc/images/spring_cloud_gateway_diagram.png and /dev/null differ
diff --git a/mvnw b/mvnw
index f44ad2b7..41c0f0c2 100755
--- a/mvnw
+++ b/mvnw
@@ -8,7 +8,7 @@
# "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
+# 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
@@ -19,7 +19,7 @@
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
+# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
@@ -114,7 +114,6 @@ if $mingw ; then
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
fi
if [ -z "$JAVA_HOME" ]; then
@@ -212,7 +211,11 @@ else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
- jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
@@ -221,22 +224,38 @@ else
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
- wget "$jarUrl" -O "$wrapperJarPath"
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
- curl -o "$wrapperJarPath" "$jarUrl"
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
@@ -277,29 +296,13 @@ if $cygwin; then
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-echo "Running version check"
-VERSION=$( sed '\!//' -e 's!.*$!!' )
-echo "The found version is [${VERSION}]"
-
-if echo $VERSION | egrep -q 'M|RC'; then
- echo Activating \"milestone\" profile for version=\"$VERSION\"
- echo $MAVEN_CONFIG | grep -q milestone || MAVEN_CONFIG="$MAVEN_CONFIG -Pmilestone"
-else
- echo Deactivating \"milestone\" profile for version=\"$VERSION\"
- echo $MAVEN_CONFIG | grep -q milestone && MAVEN_CONFIG=$(echo $MAVEN_CONFIG | sed -e 's/-Pmilestone//')
-fi
-
-if echo $VERSION | egrep -q 'RELEASE'; then
- echo Activating \"central\" profile for version=\"$VERSION\"
- echo $MAVEN_CONFIG | grep -q milestone || MAVEN_CONFIG="$MAVEN_CONFIG -Pcentral"
-else
- echo Deactivating \"central\" profile for version=\"$VERSION\"
- echo $MAVEN_CONFIG | grep -q central && MAVEN_CONFIG=$(echo $MAVEN_CONFIG | sed -e 's/-Pcentral//')
-fi
-
-
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
diff --git a/mvnw.cmd b/mvnw.cmd
index fef5a8f7..86115719 100644
--- a/mvnw.cmd
+++ b/mvnw.cmd
@@ -7,7 +7,7 @@
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
-@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@@ -18,7 +18,7 @@
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
+@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@@ -26,7 +26,7 @@
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@@ -37,7 +37,7 @@
@echo off
@REM set title of command window
title %0
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
@@ -120,23 +120,44 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
-FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
- IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
- echo Found %WRAPPER_JAR%
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
) else (
- echo Couldn't find %WRAPPER_JAR%, downloading it ...
- echo Downloading from: %DOWNLOAD_URL%
- powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
- echo Finished downloading %WRAPPER_JAR%
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
)
@REM End of extension
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
diff --git a/pom.xml b/pom.xml
index 208dfbd9..84688ecf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,287 +1,70 @@
-
-
+
+
+
4.0.0org.springframework.cloud
- spring-cloud-gateway
- 4.1.0-SNAPSHOT
- pom
+ spring-cloud-gateway-docs-build
+ 0.0.1-SNAPSHOT
- Spring Cloud Gateway
- Spring Cloud Gateway
-
-
- org.springframework.cloud
- spring-cloud-build
- 4.1.0-SNAPSHOT
-
-
+ Spring Cloud Gateway Docs Build
+ Builds Spring Cloud Gateway Docs.
+ https://spring.io/projects/spring-cloud-gateway
- https://github.com/spring-cloud/spring-cloud-gateway
-
- scm:git:git://github.com/spring-cloud/spring-cloud-gateway.git
+ scm:git:https://github.com/spring-cloud/spring-cloud-gateway.git
- scm:git:ssh://git@github.com/spring-cloud/spring-cloud-gateway.git
+ scm:git:git@github.com:spring-cloud/spring-cloud-gateway.git
- HEAD
+ https://github.com/spring-cloud/spring-cloud-gateway
-
-
-
- Apache License, Version 2.0
- https://www.apache.org/licenses/LICENSE-2.0
-
-
-
-
- sgibb
- Spencer Gibb
- sgibb at pivotal.io
- Pivotal Software, Inc.
- https://www.spring.io
-
- Project lead
-
-
-
+
+ https://github.com/spring-cloud/spring-cloud-gateway/issues
+
- UTF-8
- UTF-8
- 8.3.0
- 1.0.6.RELEASE
- 17
- 1.6.1
- 3.1.0-SNAPSHOT
- 4.1.0-SNAPSHOT
- 1.17.3
+ 0.0.3
-
-
-
- org.springframework.cloud
- spring-cloud-gateway-dependencies
- ${project.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-commons-dependencies
- ${spring-cloud-commons.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-test-support
- ${spring-cloud-commons.version}
-
-
- org.springframework.cloud
- spring-cloud-circuitbreaker-dependencies
- ${spring-cloud-circuitbreaker.version}
- pom
- import
-
-
- org.springframework.cloud
- spring-cloud-starter-circuitbreaker-reactor-resilience4j
- ${spring-cloud-circuitbreaker.version}
-
-
- org.springframework.boot
- spring-boot-devtools
- ${spring-boot.version}
-
-
- com.bucket4j
- bucket4j-core
- ${bucket4j.version}
-
-
- com.bucket4j
- bucket4j-caffeine
- ${bucket4j.version}
-
-
- io.projectreactor.tools
- blockhound
- ${blockhound.version}
-
-
- io.projectreactor.tools
- blockhound-junit-platform
- ${blockhound.version}
-
-
- org.junit-pioneer
- junit-pioneer
- ${junit-pioneer.version}
-
-
- org.testcontainers
- testcontainers-bom
- ${testcontainers.version}
- pom
- import
-
-
-
-
-
- spring-cloud-gateway-dependencies
- spring-cloud-gateway-mvc
- spring-cloud-gateway-webflux
- spring-cloud-gateway-server
- spring-cloud-gateway-server-mvc
- spring-cloud-starter-gateway
- spring-cloud-starter-gateway-mvc
- spring-cloud-gateway-sample
- spring-cloud-gateway-integration-tests
- docs
-
- org.codehaus.mojo
- flatten-maven-plugin
-
-
- io.spring.javaformat
- spring-javaformat-maven-plugin
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
+ io.spring.maven.antora
+ antora-maven-plugin
+ ${io.spring.maven.antora-version}
+ true
+
+
+
+
+
+
+
+ 9d489079e5ec46dbb238909fee5c9c29
+ WB1FQYI187
+ springcloudgateway
+
+
-
-
- spring
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- sonar
-
-
-
- org.jacoco
- jacoco-maven-plugin
-
-
- pre-unit-test
-
- prepare-agent
-
-
- surefireArgLine
- ${project.build.directory}/jacoco.exec
-
-
-
-
- post-unit-test
- test
-
- report
-
-
-
- ${project.build.directory}/jacoco.exec
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- ${surefireArgLine}
-
-
-
-
-
-
- withoutDockerTests
-
-
-
- maven-surefire-plugin
-
- DockerRequired
-
-
-
-
-
-
+
+
+ spring-snapshot
+ https://repo.spring.io/snapshot
+
+ true
+
+
+ false
+
+
+
+ spring-milestone
+ https://repo.spring.io/milestone
+
+
diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml
deleted file mode 100644
index 93b032be..00000000
--- a/spring-cloud-gateway-dependencies/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
- 4.0.0
-
- spring-cloud-dependencies-parent
- org.springframework.cloud
- 4.1.0-SNAPSHOT
-
-
-
- spring-cloud-gateway-dependencies
- 4.1.0-SNAPSHOT
- pom
-
- spring-cloud-gateway-dependencies
- Spring Cloud Gateway Dependencies
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-gateway-webflux
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-gateway-mvc
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-gateway-server
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-gateway-server-mvc
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway-mvc
- ${project.version}
-
-
-
-
-
-
- spring
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
- spring-releases
- Spring Releases
- https://repo.spring.io/release
-
- false
-
-
-
-
-
- spring-snapshots
- Spring Snapshots
- https://repo.spring.io/snapshot
-
- true
-
-
- false
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
-
-
-
-
diff --git a/spring-cloud-gateway-integration-tests/grpc/pom.xml b/spring-cloud-gateway-integration-tests/grpc/pom.xml
deleted file mode 100644
index 6b243179..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/pom.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
- 4.0.0
-
- grpc
- jar
-
- Spring Cloud Gateway gRPC Integration Test
- Spring Cloud Gateway gRPC Integration Test
-
-
- 1.47.0
-
-
-
- org.springframework.cloud
- spring-cloud-gateway-integration-tests
- 4.1.0-SNAPSHOT
- ..
-
-
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- io.grpc
- grpc-netty
- ${grpc.version}
-
-
- io.grpc
- grpc-protobuf
- ${grpc.version}
-
-
- io.grpc
- grpc-stub
- ${grpc.version}
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-protobuf
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
- io.netty
- netty-tcnative-boringssl-static
-
-
- org.apache.httpcomponents.client5
- httpclient5
- test
-
-
- org.apache.tomcat
- annotations-api
- 6.0.53
- provided
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.cloud
- spring-cloud-test-support
-
-
- io.projectreactor
- reactor-test
- test
-
-
- org.assertj
- assertj-core
- test
-
-
-
-
-
- kr.motd.maven
- os-maven-plugin
- 1.6.2
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
- org.xolstice.maven.plugins
- protobuf-maven-plugin
- 0.6.1
-
- com.google.protobuf:protoc:3.19.4:exe:${os.detected.classifier}
- grpc-java
- io.grpc:protoc-gen-grpc-java:1.44.0:exe:${os.detected.classifier}
-
-
-
-
- compile
- compile-custom
-
-
-
-
-
-
-
-
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplication.java b/spring-cloud-gateway-integration-tests/grpc/src/main/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplication.java
deleted file mode 100644
index 1f7bd2b3..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/main/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplication.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.grpc;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-import io.grpc.Grpc;
-import io.grpc.Server;
-import io.grpc.ServerCredentials;
-import io.grpc.Status;
-import io.grpc.StatusRuntimeException;
-import io.grpc.TlsServerCredentials;
-import io.grpc.stub.StreamObserver;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.SpringBootConfiguration;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.core.env.Environment;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Alberto C. Ríos
- */
-@SpringBootConfiguration
-@EnableAutoConfiguration
-public class GRPCApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(GRPCApplication.class, args);
- }
-
- @Component
- static class GRPCServer implements ApplicationRunner {
-
- private static final Logger log = LoggerFactory.getLogger(GRPCServer.class);
-
- private final Environment environment;
-
- private Server server;
-
- GRPCServer(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public void run(ApplicationArguments args) throws Exception {
- final GRPCServer server = new GRPCServer(environment);
- server.start();
- }
-
- private void start() throws IOException {
- Integer serverPort = environment.getProperty("local.server.port", Integer.class);
- int grpcPort = serverPort + 1;
- ServerCredentials creds = createServerCredentials();
- server = Grpc.newServerBuilderForPort(grpcPort, creds).addService(new HelloService()).build().start();
-
- log.info("Starting gRPC server in port " + grpcPort);
-
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
- try {
- GRPCServer.this.stop();
- }
- catch (InterruptedException e) {
- e.printStackTrace(System.err);
- }
- }));
- }
-
- private ServerCredentials createServerCredentials() throws IOException {
- File certChain = new ClassPathResource("public.cert").getFile();
- File privateKey = new ClassPathResource("private.key").getFile();
-
- return TlsServerCredentials.create(certChain, privateKey);
- }
-
- private void stop() throws InterruptedException {
- if (server != null) {
- server.shutdown().awaitTermination(30, TimeUnit.SECONDS);
- }
- }
-
- static class HelloService extends HelloServiceGrpc.HelloServiceImplBase {
-
- @Override
- public void hello(HelloRequest request, StreamObserver responseObserver) {
- if ("failWithRuntimeException!".equals(request.getFirstName())) {
- StatusRuntimeException exception = Status.FAILED_PRECONDITION.withDescription("Invalid firstName")
- .asRuntimeException();
- responseObserver.onError(exception);
- responseObserver.onCompleted();
- return;
- }
-
- String greeting = String.format("Hello, %s %s", request.getFirstName(), request.getLastName());
- log.info("Sending response: " + greeting);
-
- HelloResponse response = HelloResponse.newBuilder().setGreeting(greeting).build();
-
- responseObserver.onNext(response);
- responseObserver.onCompleted();
- }
-
- }
-
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.pb b/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.pb
deleted file mode 100644
index 30c69524..00000000
Binary files a/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.pb and /dev/null differ
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.proto b/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.proto
deleted file mode 100644
index 400d4601..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/main/proto/hello.proto
+++ /dev/null
@@ -1,17 +0,0 @@
-syntax = "proto3";
-option java_multiple_files = true;
-option java_package = "org.springframework.cloud.gateway.tests.grpc";
-package org.springframework.cloud.gateway.tests.grpc;
-
-message HelloRequest {
- optional string firstName = 1;
- optional string lastName = 2;
-}
-
-message HelloResponse {
- optional string greeting = 1;
-}
-
-service HelloService {
- rpc hello(HelloRequest) returns (HelloResponse);
-}
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/application.yml b/spring-cloud-gateway-integration-tests/grpc/src/main/resources/application.yml
deleted file mode 100644
index e69de29b..00000000
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/keystore.p12 b/spring-cloud-gateway-integration-tests/grpc/src/main/resources/keystore.p12
deleted file mode 100644
index 991ecbcf..00000000
Binary files a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/keystore.p12 and /dev/null differ
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/private.key b/spring-cloud-gateway-integration-tests/grpc/src/main/resources/private.key
deleted file mode 100644
index d9952a36..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/private.key
+++ /dev/null
@@ -1,32 +0,0 @@
-Bag Attributes
- friendlyName: bootapp
- localKeyID: 54 69 6D 65 20 31 36 35 39 39 37 34 34 38 34 30 33 30
-Key Attributes:
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQClCZtSgRjM2uYM
-O70+acD4rhwcc8ND23SwoKTNLPH6s1K2Pi5MZqF4Rnx+REJwerQrkgfMnsQ0QHcb
-NjI9dhSwHw6aPigAGJQEzR8whDu2PkR57iBmySr3GLtpR+WkVGo/xAK92ozKt9aW
-Saxm0miygYI8mgzrNpbaQAu6sZcS3RHkPYWw/izYVZLBB6IEpAJJrUqjzlu53TyN
-X4VC4FWddItjOCiyrHe2+A+tFLNK3IZnFZBqoMcYR6/Rq+zsXx8ynCggkUwTFaPd
-IVyzSYtooE2oq+aSjkJzKvoPA7BObLnrW+5Dklwj1iPtLhfuCflz2oa54/Hpl60R
-Ke6y6/t5AgMBAAECggEAQvJ/sFswDUGq2kGNhfjuT7KJMr1+81Ldphy0XYqi6li9
-77GPpGxpidnF/I6CCRCtb5NAWK/61VtlNYOpo6b3w24FxWn7XfaabMwsn8i0VDw0
-GOYQ/MEUDcJZm96PeDbKFu3TUuKKBF3IzZQ7PEaUM/03MJApN20gio46c9RAfWTK
-hN9jX9YkBpkSWPfx9RA9BOIXRrRMTXhidsVPnNxhhM7OAGZ1LhggDPaeiCIbVx6l
-yMsyCkNvqdQbKu0hFcVyeQsGjovCC1Ye71F3em3ACguqDu+VAy3flpTbcDVf2D7T
-zP2T5e5OEJ2hRTGdnEVSsXxWOWnq6Gt6ydNEe2AWVQKBgQC5HcQAUTnvIMaTez44
-7SBfELNY1AzF24dha24JFIGY78QNRZi+4Agsvxjkx4fKSd4DfmPsCqentmEkEcDr
-w6fH0CAFm/rrkzLHmesBCC8byl4WtfMW5i8h1yzOeQbYpx3MGIu5xhkE92gbNj+o
-ioM7nkoBvloU0odiYTVnoNYnFwKBgQDkO5ldA8Vl3+BWhmhOtPu+1EKssWry5rdO
-m6IiZ1uB6uG4bhAj5dSVVgDRX6pcuppMVZqIbPpdkS7/i0LVwohT7EmpMMJ5bezz
-EhG1z6AvZDcGMDC/PPMp7SLjJviYZDaTWLekKwY6yV1T9gtOY70jjWkUcfN1IHpA
-renHNNyL7wKBgQCEYvIqW+y3xFPfY1MzePoeop3wl+3ujjo6hI7z9XNdgZNO/ofn
-cebGwX+3Fa9aDwu0qe4h/9i4y2ibWAsFUS6ran+MI2oGkYXOU5hKa6TtFgPF8CfC
-J6prZCxKGSm5RYK81I0Qtchs0dblJx3NlgmWWHSK3Kwlmg5yYBzGWLLuzwKBgDzg
-rNrDq76txcAun9oGqnPPWG2J8XYTFmgQWWIF4cG4rjasnP+GSXr/8r3mX6HWYFvm
-JY8oSmv00u107wHnnseL6mYHzIfpS1/WvQSa+iZJ++dZqVcJYe8YAstGVN8JNAl/
-i5RtqX66wXso0QE613OJP7MlZgQjApkICqiJMB7fAoGAVFdv/Nphcju7MCkXGuQe
-amk7Z6Q2PjMWvLwiyB39PrIzvTOdaQyQk7oYdnAGFJbkmi7mmGiet5uvcE9OjNRb
-+XeXo2LEZ2QWJEnHi9uCXSQF3eeBlJ2wGUsELPTHglWIUTpi5iDB2hHzczPzO8GY
-qPb+ckCl8mTsHRKQQse4Bm0=
------END PRIVATE KEY-----
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/public.cert b/spring-cloud-gateway-integration-tests/grpc/src/main/resources/public.cert
deleted file mode 100644
index ecb750c6..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/main/resources/public.cert
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC1zCCAb+gAwIBAgIIEsL9TgSEch8wDQYJKoZIhvcNAQELBQAwGjEYMBYGA1UE
-AxMPbXktYm9vdC1hcHAub3JnMB4XDTIyMDgwODE2MDEyNFoXDTMyMDgwNTE2MDEy
-NFowGjEYMBYGA1UEAxMPbXktYm9vdC1hcHAub3JnMIIBIjANBgkqhkiG9w0BAQEF
-AAOCAQ8AMIIBCgKCAQEApQmbUoEYzNrmDDu9PmnA+K4cHHPDQ9t0sKCkzSzx+rNS
-tj4uTGaheEZ8fkRCcHq0K5IHzJ7ENEB3GzYyPXYUsB8Omj4oABiUBM0fMIQ7tj5E
-ee4gZskq9xi7aUflpFRqP8QCvdqMyrfWlkmsZtJosoGCPJoM6zaW2kALurGXEt0R
-5D2FsP4s2FWSwQeiBKQCSa1Ko85bud08jV+FQuBVnXSLYzgosqx3tvgPrRSzStyG
-ZxWQaqDHGEev0avs7F8fMpwoIJFMExWj3SFcs0mLaKBNqKvmko5Ccyr6DwOwTmy5
-61vuQ5JcI9Yj7S4X7gn5c9qGuePx6ZetESnusuv7eQIDAQABoyEwHzAdBgNVHQ4E
-FgQUf72EgsQASMCzSGwrFDaKnBoufm8wDQYJKoZIhvcNAQELBQADggEBAAHzJkp/
-q+U0ki+JaFaUBYg85h+yJbi262hmFjLYDQEcz2tvAw93X9ytOzVtmo2H9AgsTJYA
-z4UbJHfnTTa1KAHDHhzL/Adh/s2OZ7Y2kazLrHArFteKtGUo815JDL935JpiRBWc
-Qn1WJJ6EFb+ZRMG7oROQ3LgvrradH8G51qxvSbH/fpmEFDTSHJNIG8tXcIA3fJkI
-dsVJLygrXLzZQo5xI8rwMDX9aujRFU4Dgit58xquCkuzob/BonN7Es1Hp3beQjro
-gddts4x5wWyiFun7uYrbPVhGMJNgwRKB5e3QQA6vYDyeQqvIy6n1lnDNIxvaOfPW
-Je5gI59jCbxHs5g=
------END CERTIFICATE-----
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplicationTests.java b/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplicationTests.java
deleted file mode 100644
index e5a6bbcb..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/GRPCApplicationTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.grpc;
-
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLException;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import io.grpc.ManagedChannel;
-import io.grpc.StatusRuntimeException;
-import io.grpc.netty.GrpcSslContexts;
-import io.grpc.netty.NettyChannelBuilder;
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.web.server.LocalServerPort;
-
-import static io.grpc.Status.FAILED_PRECONDITION;
-import static io.grpc.netty.NegotiationType.TLS;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-
-/**
- * @author Alberto C. Ríos
- */
-@SpringBootTest(classes = org.springframework.cloud.gateway.tests.grpc.GRPCApplication.class,
- webEnvironment = WebEnvironment.RANDOM_PORT)
-public class GRPCApplicationTests {
-
- @LocalServerPort
- private int gatewayPort;
-
- @BeforeEach
- void setUp() {
- int grpcServerPort = gatewayPort + 1;
- final RouteConfigurer configurer = new RouteConfigurer(gatewayPort);
- configurer.addRoute(grpcServerPort, "/**", null);
- }
-
- @Test
- public void gRPCUnaryCallShouldReturnResponse() throws SSLException {
- ManagedChannel channel = createSecuredChannel(gatewayPort);
-
- final HelloResponse response = HelloServiceGrpc.newBlockingStub(channel)
- .hello(HelloRequest.newBuilder().setFirstName("Sir").setLastName("FromClient").build());
-
- Assertions.assertThat(response.getGreeting()).isEqualTo("Hello, Sir FromClient");
- }
-
- private ManagedChannel createSecuredChannel(int port) throws SSLException {
- TrustManager[] trustAllCerts = createTrustAllTrustManager();
-
- return NettyChannelBuilder.forAddress("localhost", port).useTransportSecurity()
- .sslContext(GrpcSslContexts.forClient().trustManager(trustAllCerts[0]).build()).negotiationType(TLS)
- .build();
- }
-
- @Test
- public void gRPCUnaryCallShouldHandleRuntimeException() throws SSLException {
- ManagedChannel channel = createSecuredChannel(gatewayPort);
-
- try {
- HelloServiceGrpc.newBlockingStub(channel)
- .hello(HelloRequest.newBuilder().setFirstName("failWithRuntimeException!").build());
- }
- catch (StatusRuntimeException e) {
- Assertions.assertThat(FAILED_PRECONDITION.getCode()).isEqualTo(e.getStatus().getCode());
- Assertions.assertThat("Invalid firstName").isEqualTo(e.getStatus().getDescription());
- }
- }
-
- private TrustManager[] createTrustAllTrustManager() {
- return new TrustManager[] { new X509TrustManager() {
- public X509Certificate[] getAcceptedIssuers() {
- return new X509Certificate[0];
- }
-
- public void checkClientTrusted(X509Certificate[] certs, String authType) {
- }
-
- public void checkServerTrusted(X509Certificate[] certs, String authType) {
- }
- } };
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/JsonToGrpcApplicationTests.java b/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/JsonToGrpcApplicationTests.java
deleted file mode 100644
index 95af1853..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/JsonToGrpcApplicationTests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.grpc;
-
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
-import org.apache.hc.client5.http.impl.classic.HttpClients;
-import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
-import org.apache.hc.client5.http.io.HttpClientConnectionManager;
-import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
-import org.apache.hc.client5.http.socket.PlainConnectionSocketFactory;
-import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
-import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
-import org.apache.hc.core5.http.config.Registry;
-import org.apache.hc.core5.http.config.RegistryBuilder;
-import org.apache.hc.core5.ssl.SSLContexts;
-import org.apache.hc.core5.ssl.TrustStrategy;
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.web.server.LocalServerPort;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.web.client.RestTemplate;
-
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-
-/**
- * @author Alberto C. Ríos
- * @author Abel Salgado Romero
- */
-@Disabled
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class JsonToGrpcApplicationTests {
-
- @LocalServerPort
- private int gatewayPort;
-
- private RestTemplate restTemplate;
-
- @BeforeEach
- void setUp() {
- restTemplate = createUnsecureClient();
- }
-
- @Test
- public void shouldConvertFromJSONToGRPC() {
- // Since GRPC server and GW run in same instance and don't know server port until
- // test starts,
- // we need to configure route dynamically using the actuator endpoint.
- final RouteConfigurer configurer = new RouteConfigurer(gatewayPort);
- int grpcServerPort = gatewayPort + 1;
- configurer.addRoute(grpcServerPort, "/json/hello",
- "JsonToGrpc=file:src/main/proto/hello.pb,file:src/main/proto/hello.proto,HelloService,hello");
-
- String response = restTemplate.postForEntity("https://localhost:" + this.gatewayPort + "/json/hello",
- "{\"firstName\":\"Duff\", \"lastName\":\"McKagan\"}", String.class).getBody();
-
- Assertions.assertThat(response).isNotNull();
- Assertions.assertThat(response).contains("{\"greeting\":\"Hello, Duff McKagan\"}");
- }
-
- private RestTemplate createUnsecureClient() {
- TrustStrategy acceptingTrustStrategy = (cert, authType) -> true;
- SSLContext sslContext;
- try {
- sslContext = SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build();
- }
- catch (NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
- throw new RuntimeException(e);
- }
- SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContext,
- NoopHostnameVerifier.INSTANCE);
-
- Registry socketFactoryRegistry = RegistryBuilder.create()
- .register("https", sslSocketFactory).register("http", new PlainConnectionSocketFactory()).build();
-
- HttpClientConnectionManager connectionManager = new BasicHttpClientConnectionManager(socketFactoryRegistry);
- CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();
-
- HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
-
- return new RestTemplate(requestFactory);
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/RouteConfigurer.java b/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/RouteConfigurer.java
deleted file mode 100644
index a2994833..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/test/java/org/springframework/cloud/gateway/tests/grpc/RouteConfigurer.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2013-2023 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.grpc;
-
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
-import org.apache.hc.client5.http.impl.classic.HttpClients;
-import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
-import org.apache.hc.client5.http.io.HttpClientConnectionManager;
-import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
-import org.apache.hc.client5.http.socket.PlainConnectionSocketFactory;
-import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
-import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
-import org.apache.hc.core5.http.config.Registry;
-import org.apache.hc.core5.http.config.RegistryBuilder;
-import org.apache.hc.core5.ssl.SSLContexts;
-import org.apache.hc.core5.ssl.TrustStrategy;
-
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
-import org.springframework.web.client.RestTemplate;
-
-public class RouteConfigurer {
-
- private final int actuatorPort;
-
- private final RestTemplate restTemplate;
-
- RouteConfigurer(int actuatorPort) {
- this.actuatorPort = actuatorPort;
- this.restTemplate = createUnsecureClient();
- }
-
- public void addRoute(int grpcServerPort, String path, String filter) {
- final String routeId = "test-route-" + UUID.randomUUID();
-
- Map route = new HashMap<>();
- route.put("id", routeId);
- route.put("uri", "https://localhost:" + grpcServerPort);
- route.put("predicates", Collections.singletonList("Path=" + path));
- if (filter != null) {
- route.put("filters", Arrays.asList(filter));
- }
-
- ResponseEntity exchange = restTemplate.exchange(url("/actuator/gateway/routes/" + routeId),
- HttpMethod.POST, new HttpEntity<>(route), String.class);
-
- assert exchange.getStatusCode() == HttpStatus.CREATED;
-
- refreshRoutes();
- }
-
- private void refreshRoutes() {
- ResponseEntity exchange = restTemplate.exchange(url("/actuator/gateway/refresh"), HttpMethod.POST,
- new HttpEntity<>(""), String.class);
-
- assert exchange.getStatusCode() == HttpStatus.OK;
- }
-
- private String url(String context) {
- return String.format("https://localhost:%s%s", this.actuatorPort, context);
- }
-
- private RestTemplate createUnsecureClient() {
- TrustStrategy acceptingTrustStrategy = (cert, authType) -> true;
- SSLContext sslContext;
- try {
- sslContext = SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build();
- }
- catch (NoSuchAlgorithmException | KeyStoreException | KeyManagementException e) {
- throw new RuntimeException(e);
- }
- SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContext,
- NoopHostnameVerifier.INSTANCE);
-
- Registry socketFactoryRegistry = RegistryBuilder.create()
- .register("https", sslSocketFactory).register("http", new PlainConnectionSocketFactory()).build();
-
- HttpClientConnectionManager connectionManager = new BasicHttpClientConnectionManager(socketFactoryRegistry);
- CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(connectionManager).build();
-
- HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
-
- return new RestTemplate(requestFactory);
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/grpc/src/test/resources/application.yml b/spring-cloud-gateway-integration-tests/grpc/src/test/resources/application.yml
deleted file mode 100644
index 97c1b950..00000000
--- a/spring-cloud-gateway-integration-tests/grpc/src/test/resources/application.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-server:
- http2:
- enabled: true
- ssl:
- key-store: classpath:keystore.p12
- key-store-type: pkcs12
- key-store-password: password
- key-alias: bootapp
-
-management:
- endpoint:
- health:
- show-details: when_authorized
- gateway:
- enabled: true
- endpoints:
- web:
- exposure:
- include: "*"
-
-spring:
- cloud:
- gateway:
- httpserver:
- wiretap: true
- httpclient:
- wiretap: true
- ssl:
- use-insecure-trust-manager: true
-# Requires faking domain name (modifying /etc/hosts)
-# trustedX509Certificates:
-# - classpath:public.cert
-
-logging:
- level:
- reactor.netty: DEBUG
- org.springframework.cloud.gateway.filter: DEBUG
diff --git a/spring-cloud-gateway-integration-tests/http2/pom.xml b/spring-cloud-gateway-integration-tests/http2/pom.xml
deleted file mode 100644
index 2f2093c2..00000000
--- a/spring-cloud-gateway-integration-tests/http2/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
- 4.0.0
-
- http2
- jar
-
- Spring Cloud Gateway HTTP2 Integration Test
- Spring Cloud Gateway HTTP2 Integration Test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-gateway-integration-tests
- 4.1.0-SNAPSHOT
- ..
-
-
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway
-
-
- org.springframework.cloud
- spring-cloud-starter-loadbalancer
-
-
- io.netty
- netty-tcnative-boringssl-static
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.cloud
- spring-cloud-test-support
-
-
- io.projectreactor
- reactor-test
- test
-
-
- org.assertj
- assertj-core
- test
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
diff --git a/spring-cloud-gateway-integration-tests/http2/src/main/java/org/springframework/cloud/gateway/tests/http2/Http2Application.java b/spring-cloud-gateway-integration-tests/http2/src/main/java/org/springframework/cloud/gateway/tests/http2/Http2Application.java
deleted file mode 100644
index 0fe5ed34..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/main/java/org/springframework/cloud/gateway/tests/http2/Http2Application.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.http2;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.SpringBootConfiguration;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.cloud.client.DefaultServiceInstance;
-import org.springframework.cloud.gateway.route.RouteLocator;
-import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
-import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
-import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
-import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
-import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
-import org.springframework.context.annotation.Bean;
-import org.springframework.core.env.Environment;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author Spencer Gibb
- */
-// curl -i --insecure https://localhost:8443/hello
-@SpringBootConfiguration
-@EnableAutoConfiguration
-@RestController
-@LoadBalancerClients({ @LoadBalancerClient(name = "myservice", configuration = Http2Application.MyServiceConf.class),
- @LoadBalancerClient(name = "nossl", configuration = Http2Application.NosslServiceConf.class) })
-public class Http2Application {
-
- private static Log log = LogFactory.getLog(Http2Application.class);
-
- @GetMapping("hello")
- public String hello() {
- return "Hello";
- }
-
- @Bean
- public RouteLocator myRouteLocator(RouteLocatorBuilder builder) {
- return builder.routes().route(r -> r.path("/myprefix/**").filters(f -> f.stripPrefix(1)).uri("lb://myservice"))
- .route(r -> r.path("/nossl/**").filters(f -> f.stripPrefix(1)).uri("lb://nossl"))
- .route(r -> r.path("/neverssl/**").filters(f -> f.stripPrefix(1)).uri("http://neverssl.com"))
- .route(r -> r.path("/httpbin/**").uri("https://nghttp2.org")).build();
- }
-
- public static void main(String[] args) {
- SpringApplication.run(Http2Application.class, args);
- }
-
- static class MyServiceConf {
-
- @Bean
- public ServiceInstanceListSupplier staticServiceInstanceListSupplier(Environment env) {
- Integer port = env.getProperty("local.server.port", Integer.class, 8443);
- log.info("local.server.port = " + port);
- return ServiceInstanceListSuppliers.from("myservice",
- new DefaultServiceInstance("myservice-1", "myservice", "localhost", port, true));
- }
-
- }
-
- static class NosslServiceConf {
-
- @Bean
- public ServiceInstanceListSupplier noSslStaticServiceInstanceListSupplier() {
- int port = Integer.parseInt(System.getProperty("nossl.port", "8080"));
- log.info("nossl.port = " + port);
- return ServiceInstanceListSuppliers.from("nossl",
- new DefaultServiceInstance("nossl-1", "nossl", "localhost", port, false));
- }
-
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/http2/src/main/resources/application.yml b/spring-cloud-gateway-integration-tests/http2/src/main/resources/application.yml
deleted file mode 100644
index 8438b1d5..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/main/resources/application.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-logging:
- level:
- org.springframework.cloud.gateway: TRACE
- reactor.netty.http.client: DEBUG
-
-server:
- ssl:
- key-store: classpath:sample.jks
- key-store-password: secret
- key-password: password
- http2:
- enabled: true
-
-spring:
- cloud:
- gateway:
-# httpserver:
-# wiretap: true
- httpclient:
- wiretap: true
- ssl:
- use-insecure-trust-manager: true
\ No newline at end of file
diff --git a/spring-cloud-gateway-integration-tests/http2/src/main/resources/sample.jks b/spring-cloud-gateway-integration-tests/http2/src/main/resources/sample.jks
deleted file mode 100644
index 6aa9a280..00000000
Binary files a/spring-cloud-gateway-integration-tests/http2/src/main/resources/sample.jks and /dev/null differ
diff --git a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/Http2ApplicationTests.java b/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/Http2ApplicationTests.java
deleted file mode 100644
index f609a031..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/Http2ApplicationTests.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.http2;
-
-import java.time.Duration;
-
-import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import reactor.core.publisher.Hooks;
-import reactor.core.publisher.Mono;
-import reactor.netty.http.Http2SslContextSpec;
-import reactor.netty.http.HttpProtocol;
-import reactor.netty.http.client.HttpClient;
-import reactor.netty.resources.ConnectionProvider;
-import reactor.test.StepVerifier;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.system.CapturedOutput;
-import org.springframework.boot.test.system.OutputCaptureExtension;
-import org.springframework.boot.test.web.server.LocalServerPort;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.client.reactive.ReactorClientHttpConnector;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-
-/**
- * @author Spencer Gibb
- */
-@ExtendWith(OutputCaptureExtension.class)
-@SpringBootTest(classes = Http2Application.class, webEnvironment = WebEnvironment.RANDOM_PORT)
-@DirtiesContext
-public class Http2ApplicationTests {
-
- @LocalServerPort
- int port;
-
- @Test
- public void http2Works(CapturedOutput output) {
- Hooks.onOperatorDebug();
- String uri = "https://localhost:" + port + "/myprefix/hello";
- String expected = "Hello";
- assertResponse(uri, expected);
- Assertions.assertThat(output).contains("Negotiated application-level protocol [h2]", "PRI * HTTP/2.0");
- }
-
- public static void assertResponse(String uri, String expected) {
- WebClient client = WebClient.builder().clientConnector(new ReactorClientHttpConnector(getHttpClient())).build();
- Mono> responseEntityMono = client.get().uri(uri).retrieve().toEntity(String.class);
- StepVerifier.create(responseEntityMono).assertNext(entity -> {
- assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
- assertThat(entity.getBody()).isEqualTo(expected);
- }).expectComplete().verify();
- }
-
- static HttpClient getHttpClient() {
- return HttpClient
- .create(ConnectionProvider.builder("test").maxConnections(100)
- .pendingAcquireTimeout(Duration.ofMillis(0)).pendingAcquireMaxCount(-1).build())
- .protocol(HttpProtocol.HTTP11, HttpProtocol.H2).secure(sslContextSpec -> {
- Http2SslContextSpec clientSslCtxt = Http2SslContextSpec.forClient()
- .configure(builder -> builder.trustManager(InsecureTrustManagerFactory.INSTANCE));
- sslContextSpec.sslContext(clientSslCtxt);
- });
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslConfiguration.java b/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslConfiguration.java
deleted file mode 100644
index 8a2a2d12..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslConfiguration.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.http2.nossl;
-
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@Configuration
-@EnableAutoConfiguration
-public class NosslConfiguration {
-
- @GetMapping("/")
- public String home() {
- return "nossl";
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslTests.java b/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslTests.java
deleted file mode 100644
index 78d71e2f..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/test/java/org/springframework/cloud/gateway/tests/http2/nossl/NosslTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2013-2021 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.tests.http2.nossl;
-
-import org.assertj.core.api.Assertions;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import reactor.core.publisher.Hooks;
-
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.system.CapturedOutput;
-import org.springframework.boot.test.system.OutputCaptureExtension;
-import org.springframework.boot.test.web.server.LocalServerPort;
-import org.springframework.cloud.gateway.tests.http2.Http2Application;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.util.TestSocketUtils;
-
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-import static org.springframework.cloud.gateway.tests.http2.Http2ApplicationTests.assertResponse;
-
-/**
- * @author Spencer Gibb
- */
-@ExtendWith(OutputCaptureExtension.class)
-@SpringBootTest(classes = Http2Application.class, webEnvironment = WebEnvironment.RANDOM_PORT)
-@DirtiesContext
-public class NosslTests {
-
- @LocalServerPort
- int port;
-
- @BeforeAll
- static void beforeAll() {
- int noSslPort = TestSocketUtils.findAvailableTcpPort();
- System.setProperty("nossl.port", String.valueOf(noSslPort));
- }
-
- @AfterAll
- static void afterAll() {
- System.clearProperty("nossl.port");
- }
-
- @Test
- public void http2TerminationWorks(CapturedOutput output) {
- int nosslPort = Integer.parseInt(System.getProperty("nossl.port"));
- System.err.println("nossl.port = " + nosslPort);
- Hooks.onOperatorDebug();
- try (ConfigurableApplicationContext context = new SpringApplicationBuilder(NosslConfiguration.class)
- .properties("server.port=" + nosslPort).profiles("nossl").run()) {
- String uri = "https://localhost:" + port + "/nossl";
- String expected = "nossl";
- assertResponse(uri, expected);
- Assertions.assertThat(output).doesNotContain("PRI * HTTP/2.0");
- }
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/http2/src/test/resources/application-nossl.yml b/spring-cloud-gateway-integration-tests/http2/src/test/resources/application-nossl.yml
deleted file mode 100644
index 6143bf9d..00000000
--- a/spring-cloud-gateway-integration-tests/http2/src/test/resources/application-nossl.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-server:
- ssl:
- enabled: false
- key-store: ~
- key-store-password: ~
- key-password: ~
- http2:
- enabled: false
-
-spring:
- cloud:
- gateway:
- enabled: false
\ No newline at end of file
diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml
deleted file mode 100644
index 37d9e85c..00000000
--- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
- 4.0.0
-
- mvc-failure-analyzer
- jar
-
- Spring Cloud Gateway MVC Failure Analyzer Integration Test
- Spring Cloud Gateway MVC Failure Analyzer Integration Test
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-gateway-integration-tests
- 4.1.0-SNAPSHOT
- ..
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway
-
-
- org.springframework.cloud
- spring-cloud-starter-loadbalancer
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- io.projectreactor
- reactor-test
- test
-
-
- org.assertj
- assertj-core
- test
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplication.java b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplication.java
deleted file mode 100644
index 7c23213b..00000000
--- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplication.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.sample;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.SpringBootConfiguration;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.cloud.client.DefaultServiceInstance;
-import org.springframework.cloud.gateway.route.RouteLocator;
-import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
-import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
-import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
-import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
-import org.springframework.context.annotation.Bean;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author Spencer Gibb
- */
-@SpringBootConfiguration
-@EnableAutoConfiguration
-@RestController
-@LoadBalancerClient(name = "myservice", configuration = MyServiceConf.class)
-public class MvcFailureAnalyzerApplication {
-
- @GetMapping("hello")
- public String hello() {
- return "Hello";
- }
-
- @Bean
- @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
- public RouteLocator myRouteLocator(RouteLocatorBuilder builder) {
- return builder.routes().route(r -> r.path("/myprefix/**").filters(f -> f.stripPrefix(1)).uri("lb://myservice"))
- .build();
- }
-
-}
-
-class MyServiceConf {
-
- @Value("${local.server.port}")
- private int port = 0;
-
- @Bean
- public ServiceInstanceListSupplier staticServiceInstanceListSupplier() {
- return ServiceInstanceListSuppliers.from("myservice",
- new DefaultServiceInstance("myservice-1", "myservice", "localhost", port, false));
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/resources/application.yml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/resources/application.yml
deleted file mode 100644
index 106caafa..00000000
--- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/main/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging:
- level:
- org.springframework.cloud.gateway: TRACE
diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/test/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplicationTests.java b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/test/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplicationTests.java
deleted file mode 100644
index d6528f40..00000000
--- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/src/test/java/org/springframework/cloud/gateway/sample/MvcFailureAnalyzerApplicationTests.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.sample;
-
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.test.system.CapturedOutput;
-import org.springframework.boot.test.system.OutputCaptureExtension;
-import org.springframework.cloud.gateway.support.MvcFoundOnClasspathException;
-import org.springframework.cloud.gateway.support.MvcFoundOnClasspathFailureAnalyzer;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.test.web.reactive.server.WebTestClient;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-/**
- * @author Spencer Gibb
- */
-@ExtendWith(OutputCaptureExtension.class)
-public class MvcFailureAnalyzerApplicationTests {
-
- @Test
- public void exceptionThrown(CapturedOutput output) {
- assertThatThrownBy(() -> new SpringApplication(MvcFailureAnalyzerApplication.class).run("--server.port=0"))
- .hasRootCauseInstanceOf(MvcFoundOnClasspathException.class);
- assertThat(output).contains(MvcFoundOnClasspathFailureAnalyzer.MESSAGE,
- MvcFoundOnClasspathFailureAnalyzer.ACTION);
- }
-
- @Test
- public void exceptionNotThrownWhenDisabled(CapturedOutput output) {
- assertThatCode(() -> new SpringApplication(MvcFailureAnalyzerApplication.class)
- .run("--spring.cloud.gateway.enabled=false", "--server.port=0")).doesNotThrowAnyException();
- assertThat(output).doesNotContain(MvcFoundOnClasspathFailureAnalyzer.MESSAGE,
- MvcFoundOnClasspathFailureAnalyzer.ACTION);
- }
-
- @Test
- public void exceptionNotThrownWhenReactiveTypeSet(CapturedOutput output) {
- assertThatCode(() -> {
- ConfigurableApplicationContext context = new SpringApplication(MvcFailureAnalyzerApplication.class)
- .run("--spring.main.web-application-type=reactive", "--server.port=0", "--debug=true");
- Integer port = context.getEnvironment().getProperty("local.server.port", Integer.class);
- WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port).build();
- client.get().uri("/myprefix/hello").exchange().expectStatus().isOk().expectBody(String.class)
- .isEqualTo("Hello");
- context.close();
- }).doesNotThrowAnyException();
- assertThat(output).doesNotContain(MvcFoundOnClasspathFailureAnalyzer.MESSAGE,
- MvcFoundOnClasspathFailureAnalyzer.ACTION);
-
- }
-
-}
diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml
deleted file mode 100644
index 5282307a..00000000
--- a/spring-cloud-gateway-integration-tests/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
- 4.0.0
-
- spring-cloud-gateway-integration-tests
- pom
-
- Spring Cloud Gateway Integration Tests
- Spring Cloud Gateway Integration Tests
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-gateway
- 4.1.0-SNAPSHOT
- ..
-
-
-
- grpc
- http2
- mvc-failure-analyzer
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
diff --git a/spring-cloud-gateway-mvc/.jdk8 b/spring-cloud-gateway-mvc/.jdk8
deleted file mode 100644
index e69de29b..00000000
diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml
deleted file mode 100644
index cf3703c7..00000000
--- a/spring-cloud-gateway-mvc/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
- 4.0.0
-
- spring-cloud-gateway-mvc
- spring-cloud-gateway-mvc
- Spring Cloud Gateway MVC
-
-
- org.springframework.cloud
- spring-cloud-gateway
- 4.1.0-SNAPSHOT
- ..
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-autoconfigure-processor
- true
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.junit.vintage
- junit-vintage-engine
- test
-
-
- org.springframework.boot
- spring-boot-starter-actuator
- test
-
-
- org.apache.httpcomponents
- httpclient
- 4.5.14
- test
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
-
diff --git a/spring-cloud-gateway-mvc/src/main/java/org/springframework/cloud/gateway/mvc/ProxyExchange.java b/spring-cloud-gateway-mvc/src/main/java/org/springframework/cloud/gateway/mvc/ProxyExchange.java
deleted file mode 100644
index e1bb63f8..00000000
--- a/spring-cloud-gateway-mvc/src/main/java/org/springframework/cloud/gateway/mvc/ProxyExchange.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Copyright 2016-2019 the original author or authors.
- *
- * 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
- *
- * 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.
- */
-
-package org.springframework.cloud.gateway.mvc;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-import jakarta.servlet.ReadListener;
-import jakarta.servlet.ServletInputStream;
-import jakarta.servlet.ServletOutputStream;
-import jakarta.servlet.WriteListener;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletRequestWrapper;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.servlet.http.HttpServletResponseWrapper;
-
-import org.springframework.core.Conventions;
-import org.springframework.core.MethodParameter;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.RequestEntity;
-import org.springframework.http.RequestEntity.BodyBuilder;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.HttpMessageNotWritableException;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.StringUtils;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.HttpMediaTypeNotAcceptableException;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.support.WebDataBinderFactory;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.context.request.ServletWebRequest;
-import org.springframework.web.context.request.WebRequest;
-import org.springframework.web.method.support.ModelAndViewContainer;
-import org.springframework.web.servlet.HandlerMapping;
-import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor;
-
-/**
- * A @RequestMapping argument type that can proxy the request to a backend.
- * Spring will inject one of these into your MVC handler method, and you get return a
- * ResponseEntity that you get from one of the HTTP methods {@link #get()},
- * {@link #post()}, {@link #put()}, {@link #patch()}, {@link #delete()} etc. Example:
- *
- *
- * By default the incoming request body and headers are sent intact to the downstream
- * service (with the exception of "sensitive" headers). To manipulate the downstream
- * request there are "builder" style methods in {@link ProxyExchange}, but only the
- * {@link #uri(String)} is mandatory. You can change the sensitive headers by calling the
- * {@link #sensitive(String...)} method (Authorization and Cookie are sensitive by
- * default).
- *
- *
- * The type parameter T in ProxyExchange<T> is the type of
- * the response body, so it comes out in the {@link ResponseEntity} that you return from
- * your @RequestMapping. If you don't care about the type of the request and
- * response body (e.g. if it's just a passthru) then use a wildcard, or
- * byte[] or Object. Use a concrete type if you want to
- * transform or manipulate the response, or if you want to assert that it is convertible
- * to the type you declare.
- *
- *
- * To manipulate the response use the overloaded HTTP methods with a Function
- * argument and pass in code to transform the response. E.g.
- *
- *
- * The full machinery of Spring {@link HttpMessageConverter message converters} is applied
- * to the incoming request and response and also to the backend request. If you need
- * additional converters then they need to be added upstream in the MVC configuration and
- * also to the {@link RestTemplate} that is used in the backend calls (see the
- * {@link ProxyExchange#ProxyExchange(RestTemplate, NativeWebRequest, ModelAndViewContainer, WebDataBinderFactory, Type)
- * constructor} for details).
- *
- *
- * As well as the HTTP methods for a backend call you can also use
- * {@link #forward(String)} for a local in-container dispatch.
- *
- *
- *
- * @author Dave Syer
- *
- */
-public class ProxyExchange {
-
- /**
- * Contains headers that are considered case-sensitive by default.
- */
- public static Set DEFAULT_SENSITIVE = Collections
- .unmodifiableSet(new HashSet<>(Arrays.asList("cookie", "authorization")));
-
- private URI uri;
-
- private RestTemplate rest;
-
- private Object body;
-
- private RequestResponseBodyMethodProcessor delegate;
-
- private NativeWebRequest webRequest;
-
- private ModelAndViewContainer mavContainer;
-
- private WebDataBinderFactory binderFactory;
-
- private Set sensitive;
-
- private HttpHeaders headers = new HttpHeaders();
-
- private Type responseType;
-
- public ProxyExchange(RestTemplate rest, NativeWebRequest webRequest, ModelAndViewContainer mavContainer,
- WebDataBinderFactory binderFactory, Type type) {
- this.responseType = type;
- this.rest = rest;
- this.webRequest = webRequest;
- this.mavContainer = mavContainer;
- this.binderFactory = binderFactory;
- this.delegate = new RequestResponseBodyMethodProcessor(rest.getMessageConverters());
- }
-
- /**
- * Sets the body for the downstream request (if using {@link #post()}, {@link #put()}
- * or {@link #patch()}). The body can be omitted if you just want to pass the incoming
- * request downstream without changing it. If you want to transform the incoming
- * request you can declare it as a @RequestBody in your
- * @RequestMapping in the usual Spring MVC way.
- * @param body the request body to send downstream
- * @return this for convenience
- */
- public ProxyExchange body(Object body) {
- this.body = body;
- return this;
- }
-
- /**
- * Sets a header for the downstream call.
- * @param name Header name
- * @param value Header values
- * @return this for convenience
- */
- public ProxyExchange header(String name, String... value) {
- this.headers.put(name, Arrays.asList(value));
- return this;
- }
-
- /**
- * Additional headers, or overrides of the incoming ones, to be used in the downstream
- * call.
- * @param headers the http headers to use in the downstream call
- * @return this for convenience
- */
- public ProxyExchange headers(HttpHeaders headers) {
- this.headers.putAll(headers);
- return this;
- }
-
- /**
- * Sets the names of sensitive headers that are not passed downstream to the backend
- * service.
- * @param names the names of sensitive headers
- * @return this for convenience
- */
- public ProxyExchange sensitive(String... names) {
- if (this.sensitive == null) {
- this.sensitive = new HashSet<>();
- }
-
- this.sensitive.clear();
- for (String name : names) {
- this.sensitive.add(name.toLowerCase());
- }
- return this;
- }
-
- /**
- * Sets the uri for the backend call when triggered by the HTTP methods.
- * @param uri the backend uri to send the request to
- * @return this for convenience
- */
- public ProxyExchange uri(URI uri) {
- this.uri = uri;
- return this;
- }
-
- /**
- * Sets the uri for the backend call when triggered by the HTTP methods.
- * @param uri the backend uri to send the request to
- * @return this for convenience
- */
- public ProxyExchange uri(String uri) {
- try {
- return this.uri(new URI(uri));
- }
- catch (URISyntaxException e) {
- throw new IllegalStateException("Cannot create URI", e);
- }
- }
-
- public String path() {
- return (String) this.webRequest.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE,
- WebRequest.SCOPE_REQUEST);
- }
-
- public String path(String prefix) {
- String path = path();
- if (!path.startsWith(prefix)) {
- throw new IllegalArgumentException("Path does not start with prefix (" + prefix + "): " + path);
- }
- return path.substring(prefix.length());
- }
-
- public void forward(String path) {
- HttpServletRequest request = this.webRequest.getNativeRequest(HttpServletRequest.class);
- HttpServletResponse response = this.webRequest.getNativeResponse(HttpServletResponse.class);
- try {
- request.getRequestDispatcher(path).forward(new BodyForwardingHttpServletRequest(request, response),
- response);
- }
- catch (Exception e) {
- throw new IllegalStateException("Cannot forward request", e);
- }
- }
-
- public ResponseEntity get() {
- RequestEntity> requestEntity = headers((BodyBuilder) RequestEntity.get(uri)).body(body());
- return exchange(requestEntity);
- }
-
- public ResponseEntity get(Function, ResponseEntity> converter) {
- return converter.apply(get());
- }
-
- public ResponseEntity head() {
- RequestEntity> requestEntity = headers((BodyBuilder) RequestEntity.head(uri)).build();
- return exchange(requestEntity);
- }
-
- public ResponseEntity head(Function, ResponseEntity> converter) {
- return converter.apply(head());
- }
-
- public ResponseEntity options() {
- RequestEntity> requestEntity = headers((BodyBuilder) RequestEntity.options(uri)).build();
- return exchange(requestEntity);
- }
-
- public ResponseEntity options(Function, ResponseEntity> converter) {
- return converter.apply(options());
- }
-
- public ResponseEntity post() {
- RequestEntity