diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java index 474be33..959fea7 100755 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -1,3 +1,4 @@ + /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -21,87 +22,96 @@ import java.util.Properties; public class MavenWrapperDownloader { - /** - * 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/0.4.0/maven-wrapper-0.4.0.jar"; + /** + * 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/0.4.0/maven-wrapper-0.4.0.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 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"; + /** + * 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"; + /** + * 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()); + 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); + // 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 direcrory '" + 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); - } - } + File outputFile = new File(baseDirectory.getAbsolutePath(), + MAVEN_WRAPPER_JAR_PATH); + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { + System.out.println("- ERROR creating output direcrory '" + + 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 { - 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(); - } + private static void downloadFileFromURL(String urlString, File destination) + throws Exception { + 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/.settings.xml b/.settings.xml index 08951ca..03645e8 100644 --- a/.settings.xml +++ b/.settings.xml @@ -1,66 +1,68 @@ - - - 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 - - - - - + + + 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/README.adoc b/README.adoc index dce7c27..547195d 100644 --- a/README.adoc +++ b/README.adoc @@ -4,9 +4,9 @@ Manual changes to this file will be lost when it is generated again. Edit the files in the src/main/asciidoc/ directory instead. //// -image::https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] -image::https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker/branch/master/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] -image::https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d118["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud-Incubator/spring-cloud-circuitbreaker?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-circuitbreaker&utm_campaign=Badge_Grade"] +image::https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker.svg?style=svg["CircleCI",link="https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] +image::https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker/branch/master/graph/badge.svg["Codecov",link="https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] +image::https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d118["Codacy code quality",link="https://www.codacy.com/app/Spring-Cloud-Incubator/spring-cloud-circuitbreaker?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-circuitbreaker&utm_campaign=Badge_Grade"] :github-tag: master :github-repo: spring-cloud-incubator/spring-cloud-circuitbreaker @@ -23,8 +23,7 @@ image::https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d1 == Introduction Spring Cloud Circuit breaker provides an abstraction across different circuit breaker implementations. -It provides a consistent API to use in your applications allowing you the developer to choose the circuit -breaker implementation that best fits your needs for your app. +It provides a consistent API to use in your applications allowing you the developer to choose the circuit breaker implementation that best fits your needs for your app. === Supported Implementations @@ -35,9 +34,8 @@ breaker implementation that best fits your needs for your app. == Core Concepts -To create a circuit breaker in your code you can use the `CircuitBreakerFactory` API. When you include a Spring -Cloud Circuit Breaker starter on your classpath a bean implementing this API will automatically be created -for you. A very simple example of using this API is given below +To create a circuit breaker in your code you can use the `CircuitBreakerFactory` API. When you include a Spring Cloud Circuit Breaker starter on your classpath a bean implementing this API will automatically be created for you. +A very simple example of using this API is given below ==== [source,java] @@ -61,15 +59,15 @@ public static class DemoControllerService { ==== The `CircuitBreakerFactory.create` API will create an instance of a class called `CircuitBreaker`. -The `run` method takes a `Supplier` and a `Function`. The `Supplier` is the code that you are going to -wrap in a circuit breaker. The `Function` is the fallback that will be executed if the circuit -breaker is tripped. The function will be passed the `Throwable` that caused the fallback to be -triggered. You can optionally exclude the fallback if you do not want to provide one. +The `run` method takes a `Supplier` and a `Function`. +The `Supplier` is the code that you are going to wrap in a circuit breaker. +The `Function` is the fallback that will be executed if the circuit breaker is tripped. +The function will be passed the `Throwable` that caused the fallback to be triggered. +You can optionally exclude the fallback if you do not want to provide one. === Circuit Breakers In Reactive Code -If Project Reactor is on the class path then you can also use `ReactiveCircuitBreakerFactory` for your reactive -code. +If Project Reactor is on the class path then you can also use `ReactiveCircuitBreakerFactory` for your reactive code. ==== [source,java] @@ -94,14 +92,14 @@ public static class DemoControllerService { ==== The `ReactiveCircuitBreakerFactory.create` API will create an instance of a class called `ReactiveCircuitBreaker`. -The `run` method takes with a `Mono` or `Flux` and wraps it in a circuit breaker. You can optionally profile -a fallback `Function` which will be called if the circuit breaker is tripped and will be passed the `Throwable` +The `run` method takes with a `Mono` or `Flux` and wraps it in a circuit breaker. +You can optionally profile a fallback `Function` which will be called if the circuit breaker is tripped and will be passed the `Throwable` that caused the failure. == Configuration -You can configure your circuit breakers using by creating beans of type `Customizer`. The `Customizer` interface -has a single method called `customize` that takes in the `Object` to customize. +You can configure your circuit breakers using by creating beans of type `Customizer`. +The `Customizer` interface has a single method called `customize` that takes in the `Object` to customize. === Configuring Hystrix Circuit Breakers @@ -139,7 +137,6 @@ public Customizer defaultConfig() { ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customize` bean this is passed a @@ -169,7 +166,6 @@ public Customizer customizer() { ---- ==== - === Configuring Resilience4J Circuit Breakers ==== Default Configuration @@ -205,7 +201,6 @@ public Customizer defaultCustomizer() ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customize` bean this is passed a @@ -222,9 +217,10 @@ public Customizer slowCustomizer() { ---- ==== -In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it -has been created but before it is returned to the caller. To do this you can use the `addCircuitBreakerCustomizer` -method. This can be useful for adding event handlers to Resilience4J circuit breakers. +In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it has been created but before it is returned to the caller. +To do this you can use the `addCircuitBreakerCustomizer` +method. +This can be useful for adding event handlers to Resilience4J circuit breakers. ==== [source,java] @@ -255,7 +251,6 @@ public Customizer slowCusomtizer() { ---- ==== - === Configuring Sentinel Circuit Breakers ==== Default Configuration @@ -279,7 +274,6 @@ You can choose to provide default circuit breaking rules via `SentinelConfigBuil You can also choose to load circuit breaking rules later elsewhere using `DegradeRuleManager.loadRules(rules)` API of Sentinel, or via Sentinel dashboard. - ===== Reactive Example ==== @@ -293,7 +287,6 @@ public Customizer defaultCustomizer() { ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customizer` bean this is passed a @@ -334,16 +327,15 @@ public Customizer customizer() { === Configuring Spring Retry Circuit Breakers -Spring Retry provides declarative retry support for Spring applications. A subset of the project -includes the ability to implement circuit breaker functionality. Spring Retry provides a circuit breaker -implementation via a combination of it's +Spring Retry provides declarative retry support for Spring applications. +A subset of the project includes the ability to implement circuit breaker functionality. +Spring Retry provides a circuit breaker implementation via a combination of it's https://github.com/spring-projects/spring-retry/blob/master/src/main/java/org/springframework/retry/policy/CircuitBreakerRetryPolicy.java[`CircuitBreakerRetryPolicy`] -and a https://github.com/spring-projects/spring-retry#stateful-retry[stateful retry]. All circuit -breakers created using Spring Retry will be created using the `CircuitBreakerRetryPolicy` and a +and a https://github.com/spring-projects/spring-retry#stateful-retry[stateful retry]. +All circuit breakers created using Spring Retry will be created using the `CircuitBreakerRetryPolicy` and a https://github.com/spring-projects/spring-retry/blob/master/src/main/java/org/springframework/retry/support/DefaultRetryState.java[`DefaultRetryState`]. Both of these classes can be configured using `SpringRetryConfigBuilder`. - ==== Default Configuration To provide a default configuration for all of your circuit breakers create a `Customize` bean that is passed a @@ -376,9 +368,10 @@ public Customizer slowCustomizer() { ---- ==== -In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it -has been created but before it is returned to the caller. To do this you can use the `addRetryTemplateCustomizers` -method. This can be useful for adding event handlers to the `RetryTemplate`. +In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it has been created but before it is returned to the caller. +To do this you can use the `addRetryTemplateCustomizers` +method. +This can be useful for adding event handlers to the `RetryTemplate`. ==== [source,java] @@ -414,79 +407,65 @@ public Customizer slowCustomizer() { 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 +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 ---- $ ./mvnw install ---- -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. +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. -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. +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. -For hints on how to build the project look in `.travis.yml` if there -is one. There should be a "script" and maybe "install" command. Also -look at the "services" section to see if any services need to be -running locally (e.g. mongo or rabbit). Ignore the git-related bits -that you might find in "before_install" since they're related to setting git -credentials and you already have those. +For hints on how to build the project look in `.travis.yml` if there is one. +There should be a "script" and maybe "install" command. +Also look at the "services" section to see if any services need to be running locally (e.g. mongo or rabbit). +Ignore the git-related bits that you might find in "before_install" since they're related to setting git credentials and you already have those. The projects that require middleware generally include a `docker-compose.yml`, so consider using -https://docs.docker.com/compose/[Docker Compose] to run the middeware servers -in Docker containers. See the README in the +https://docs.docker.com/compose/[Docker Compose] to run the middeware servers in Docker containers. +See the README in the https://github.com/spring-cloud-samples/scripts[scripts demo -repository] for specific instructions about the common cases of mongo, -rabbit and redis. +repository] for specific instructions about the common cases of mongo, rabbit and redis. NOTE: If all else fails, build with the command from `.travis.yml` (usually `./mvnw install`). === 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. +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. +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. ==== 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`. +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: + +If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command: [indent=0] ---- @@ -496,60 +475,54 @@ following command: 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. +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. +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. +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 +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 + 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). + `@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). +* 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 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/ ---- @@ -567,7 +540,8 @@ Spring Cloud Build comes with a set of checkstyle rules. You can find them in th ==== Checkstyle configuration -Checkstyle rules are *disabled by default*. To add checkstyle to your project just define the following properties and plugins. +Checkstyle rules are *disabled by default*. +To add checkstyle to your project just define the following properties and plugins. .pom.xml ---- @@ -607,7 +581,8 @@ Checkstyle rules are *disabled by default*. To add checkstyle to your project ju <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: +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 ---- @@ -621,7 +596,9 @@ If you need to suppress some rules (e.g. line length needs to be longer), then i ---- -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: +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 @@ -654,27 +631,37 @@ In order to setup Intellij you should import our coding conventions, inspection <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. +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. +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 +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: +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/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`. +- `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. \ No newline at end of file +IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources. diff --git a/docs/pom.xml b/docs/pom.xml index 4a34138..f8d569b 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -1,6 +1,6 @@ - spring-cloud-circuitbreaker @@ -54,4 +54,4 @@ - \ No newline at end of file + diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc index d2b7974..8923c79 100644 --- a/docs/src/main/asciidoc/README.adoc +++ b/docs/src/main/asciidoc/README.adoc @@ -1,5 +1,5 @@ -image::https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] -image::https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker/branch/master/graph/badge.svg["Codecov", link="https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] -image::https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d118["Codacy code quality", link="https://www.codacy.com/app/Spring-Cloud-Incubator/spring-cloud-circuitbreaker?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-circuitbreaker&utm_campaign=Badge_Grade"] +image::https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker.svg?style=svg["CircleCI",link="https://circleci.com/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] +image::https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker/branch/master/graph/badge.svg["Codecov",link="https://codecov.io/gh/spring-cloud-incubator/spring-cloud-circuitbreaker"] +image::https://api.codacy.com/project/badge/Grade/a6885a06921e4f72a0df0b7aabd6d118["Codacy code quality",link="https://www.codacy.com/app/Spring-Cloud-Incubator/spring-cloud-circuitbreaker?utm_source=github.com&utm_medium=referral&utm_content=spring-cloud/spring-cloud-circuitbreaker&utm_campaign=Badge_Grade"] -include::spring-cloud-circuitbreaker.adoc[] \ No newline at end of file +include::spring-cloud-circuitbreaker.adoc[] diff --git a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-hystrix.adoc b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-hystrix.adoc index fb55f2b..58ff85c 100644 --- a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-hystrix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-hystrix.adoc @@ -34,7 +34,6 @@ public Customizer defaultConfig() { ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customize` bean this is passed a diff --git a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-resilience4j.adoc b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-resilience4j.adoc index 5ae4aaa..727f985 100644 --- a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-resilience4j.adoc +++ b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-resilience4j.adoc @@ -1,8 +1,8 @@ === Configuring Resilience4J Circuit Breakers ==== Starters -There are two starters for the Resilience4J implementations, one for reactive applications and -one for non-reactive applications. + +There are two starters for the Resilience4J implementations, one for reactive applications and one for non-reactive applications. * `org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j` - non-reactive applications * `org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j` - reactive applications @@ -40,7 +40,6 @@ public Customizer defaultCustomizer() ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customize` bean this is passed a @@ -57,9 +56,10 @@ public Customizer slowCustomizer() { ---- ==== -In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it -has been created but before it is returned to the caller. To do this you can use the `addCircuitBreakerCustomizer` -method. This can be useful for adding event handlers to Resilience4J circuit breakers. +In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it has been created but before it is returned to the caller. +To do this you can use the `addCircuitBreakerCustomizer` +method. +This can be useful for adding event handlers to Resilience4J circuit breakers. ==== [source,java] diff --git a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-sentinel.adoc b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-sentinel.adoc index 6671dff..77a5a32 100644 --- a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-sentinel.adoc +++ b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-sentinel.adoc @@ -21,7 +21,6 @@ You can choose to provide default circuit breaking rules via `SentinelConfigBuil You can also choose to load circuit breaking rules later elsewhere using `DegradeRuleManager.loadRules(rules)` API of Sentinel, or via Sentinel dashboard. - ===== Reactive Example ==== @@ -35,7 +34,6 @@ public Customizer defaultCustomizer() { ---- ==== - ==== Specific Circuit Breaker Configuration Similarly to providing a default configuration, you can create a `Customizer` bean this is passed a diff --git a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-spring-retry.adoc b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-spring-retry.adoc index 06f1a19..5fba8a9 100644 --- a/docs/src/main/asciidoc/spring-cloud-circuitbreaker-spring-retry.adoc +++ b/docs/src/main/asciidoc/spring-cloud-circuitbreaker-spring-retry.adoc @@ -1,15 +1,14 @@ === Configuring Spring Retry Circuit Breakers -Spring Retry provides declarative retry support for Spring applications. A subset of the project -includes the ability to implement circuit breaker functionality. Spring Retry provides a circuit breaker -implementation via a combination of it's +Spring Retry provides declarative retry support for Spring applications. +A subset of the project includes the ability to implement circuit breaker functionality. +Spring Retry provides a circuit breaker implementation via a combination of it's https://github.com/spring-projects/spring-retry/blob/master/src/main/java/org/springframework/retry/policy/CircuitBreakerRetryPolicy.java[`CircuitBreakerRetryPolicy`] -and a https://github.com/spring-projects/spring-retry#stateful-retry[stateful retry]. All circuit -breakers created using Spring Retry will be created using the `CircuitBreakerRetryPolicy` and a +and a https://github.com/spring-projects/spring-retry#stateful-retry[stateful retry]. +All circuit breakers created using Spring Retry will be created using the `CircuitBreakerRetryPolicy` and a https://github.com/spring-projects/spring-retry/blob/master/src/main/java/org/springframework/retry/support/DefaultRetryState.java[`DefaultRetryState`]. Both of these classes can be configured using `SpringRetryConfigBuilder`. - ==== Default Configuration To provide a default configuration for all of your circuit breakers create a `Customize` bean that is passed a @@ -42,9 +41,10 @@ public Customizer slowCustomizer() { ---- ==== -In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it -has been created but before it is returned to the caller. To do this you can use the `addRetryTemplateCustomizers` -method. This can be useful for adding event handlers to the `RetryTemplate`. +In addition to configuring the circuit breaker that is created you can also customize the circuit breaker after it has been created but before it is returned to the caller. +To do this you can use the `addRetryTemplateCustomizers` +method. +This can be useful for adding event handlers to the `RetryTemplate`. ==== [source,java] diff --git a/docs/src/main/asciidoc/spring-cloud-circuitbreaker.adoc b/docs/src/main/asciidoc/spring-cloud-circuitbreaker.adoc index ab0b546..ff04a2d 100755 --- a/docs/src/main/asciidoc/spring-cloud-circuitbreaker.adoc +++ b/docs/src/main/asciidoc/spring-cloud-circuitbreaker.adoc @@ -13,8 +13,7 @@ == Introduction Spring Cloud Circuit breaker provides an abstraction across different circuit breaker implementations. -It provides a consistent API to use in your applications allowing you the developer to choose the circuit -breaker implementation that best fits your needs for your app. +It provides a consistent API to use in your applications allowing you the developer to choose the circuit breaker implementation that best fits your needs for your app. === Supported Implementations @@ -25,9 +24,8 @@ breaker implementation that best fits your needs for your app. == Core Concepts -To create a circuit breaker in your code you can use the `CircuitBreakerFactory` API. When you include a Spring -Cloud Circuit Breaker starter on your classpath a bean implementing this API will automatically be created -for you. A very simple example of using this API is given below +To create a circuit breaker in your code you can use the `CircuitBreakerFactory` API. When you include a Spring Cloud Circuit Breaker starter on your classpath a bean implementing this API will automatically be created for you. +A very simple example of using this API is given below ==== [source,java] @@ -51,15 +49,15 @@ public static class DemoControllerService { ==== The `CircuitBreakerFactory.create` API will create an instance of a class called `CircuitBreaker`. -The `run` method takes a `Supplier` and a `Function`. The `Supplier` is the code that you are going to -wrap in a circuit breaker. The `Function` is the fallback that will be executed if the circuit -breaker is tripped. The function will be passed the `Throwable` that caused the fallback to be -triggered. You can optionally exclude the fallback if you do not want to provide one. +The `run` method takes a `Supplier` and a `Function`. +The `Supplier` is the code that you are going to wrap in a circuit breaker. +The `Function` is the fallback that will be executed if the circuit breaker is tripped. +The function will be passed the `Throwable` that caused the fallback to be triggered. +You can optionally exclude the fallback if you do not want to provide one. === Circuit Breakers In Reactive Code -If Project Reactor is on the class path then you can also use `ReactiveCircuitBreakerFactory` for your reactive -code. +If Project Reactor is on the class path then you can also use `ReactiveCircuitBreakerFactory` for your reactive code. ==== [source,java] @@ -84,14 +82,14 @@ public static class DemoControllerService { ==== The `ReactiveCircuitBreakerFactory.create` API will create an instance of a class called `ReactiveCircuitBreaker`. -The `run` method takes with a `Mono` or `Flux` and wraps it in a circuit breaker. You can optionally profile -a fallback `Function` which will be called if the circuit breaker is tripped and will be passed the `Throwable` +The `run` method takes with a `Mono` or `Flux` and wraps it in a circuit breaker. +You can optionally profile a fallback `Function` which will be called if the circuit breaker is tripped and will be passed the `Throwable` that caused the failure. == Configuration -You can configure your circuit breakers using by creating beans of type `Customizer`. The `Customizer` interface -has a single method called `customize` that takes in the `Object` to customize. +You can configure your circuit breakers using by creating beans of type `Customizer`. +The `Customizer` interface has a single method called `customize` that takes in the `Object` to customize. include::spring-cloud-circuitbreaker-hystrix.adoc[] diff --git a/mvnw b/mvnw index 4f6e87f..640b45d 100755 --- a/mvnw +++ b/mvnw @@ -34,129 +34,136 @@ # MAVEN_SKIP_RC - flag to disable loading of mavenrc files # ---------------------------------------------------------------------------- -if [ -z "$MAVEN_SKIP_RC" ] ; then +if [ -z "$MAVEN_SKIP_RC" ]; then - if [ -f /etc/mavenrc ] ; then + if [ -f /etc/mavenrc ]; then . /etc/mavenrc fi - if [ -f "$HOME/.mavenrc" ] ; then + if [ -f "$HOME/.mavenrc" ]; then . "$HOME/.mavenrc" fi fi # OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; +cygwin=false +darwin=false mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi +case "$(uname)" in +CYGWIN*) cygwin=true ;; +MINGW*) mingw=true ;; +Darwin*) + darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="$(/usr/libexec/java_home)" + else + export JAVA_HOME="/Library/Java/Home" fi - ;; + fi + ;; esac -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` +if [ -z "$JAVA_HOME" ]; then + if [ -r /etc/gentoo-release ]; then + JAVA_HOME=$(java-config --jre-home) fi fi -if [ -z "$M2_HOME" ] ; then +if [ -z "$M2_HOME" ]; then ## resolve links - $0 may be a link to maven's home PRG="$0" # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then + while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then PRG="$link" else - PRG="`dirname "$PRG"`/$link" + PRG="$(dirname "$PRG")/$link" fi done - saveddir=`pwd` + saveddir=$(pwd) - M2_HOME=`dirname "$PRG"`/.. + M2_HOME=$(dirname "$PRG")/.. # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` + M2_HOME=$(cd "$M2_HOME" && pwd) cd "$saveddir" # echo Using m2 at $M2_HOME fi # For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then +if $cygwin; then [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` + M2_HOME=$(cygpath --unix "$M2_HOME") [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") fi # For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then +if $mingw; then [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" + M2_HOME="$( ( + cd "$M2_HOME" + pwd + ))" [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + JAVA_HOME="$( ( + cd "$JAVA_HOME" + pwd + ))" # TODO classpath? fi if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + readLink=$(which readlink) + if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then + if $darwin; then + javaHome="$(dirname \"$javaExecutable\")" + javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac" else - javaExecutable="`readlink -f \"$javaExecutable\"`" + javaExecutable="$(readlink -f \"$javaExecutable\")" fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` + javaHome="$(dirname \"$javaExecutable\")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') JAVA_HOME="$javaHome" export JAVA_HOME fi fi fi -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +if [ -z "$JAVACMD" ]; then + if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else - JAVACMD="`which java`" + JAVACMD="$(which java)" fi fi -if [ ! -x "$JAVACMD" ] ; then +if [ ! -x "$JAVACMD" ]; then echo "Error: JAVA_HOME is not defined correctly." >&2 echo " We cannot execute $JAVACMD" >&2 exit 1 fi -if [ -z "$JAVA_HOME" ] ; then +if [ -z "$JAVA_HOME" ]; then echo "Warning: JAVA_HOME environment variable is not set." fi @@ -166,22 +173,24 @@ CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher # first directory with .mvn subdirectory is considered project base directory find_maven_basedir() { - if [ -z "$1" ] - then + if [ -z "$1" ]; then echo "Path not specified to find_maven_basedir" return 1 fi basedir="$1" wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.mvn ]; then basedir=$wdir break fi # workaround for JBEAP-8937 (on Solaris 10/Sparc) if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` + wdir=$( + cd "$wdir/.." + pwd + ) fi # end of workaround done @@ -191,13 +200,13 @@ find_maven_basedir() { # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" + echo "$(tr -s '\n' ' ' <"$1")" fi } -BASE_DIR=`find_maven_basedir "$(pwd)"` +BASE_DIR=$(find_maven_basedir "$(pwd)") if [ -z "$BASE_DIR" ]; then - exit 1; + exit 1 fi ########################################################################################## @@ -205,55 +214,58 @@ fi # This allows using the maven wrapper in projects that prohibit checking in binary data. ########################################################################################## if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi 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.0/maven-wrapper-0.4.0.jar" - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + 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.0/maven-wrapper-0.4.0.jar" + while IFS="=" read key value; do + case "$key" in wrapperUrl) + jarUrl="$value" + break + ;; + esac + done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - wget "$jarUrl" -O "$wrapperJarPath" - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - curl -o "$wrapperJarPath" "$jarUrl" - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi + if command -v wget >/dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl >/dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi fi ########################################################################################## # End of extension @@ -268,35 +280,35 @@ MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` + M2_HOME=$(cygpath --path --windows "$M2_HOME") [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") fi WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain echo "Running version check" -VERSION=$( sed '\!//' -e 's!.*$!!' ) +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" + 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//') + 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" + 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//') + 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" \ diff --git a/pom.xml b/pom.xml index 18e0b55..3c893a9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,112 +1,113 @@ - - 4.0.0 + + 4.0.0 - org.springframework.cloud - spring-cloud-circuitbreaker - pom - 0.0.1.BUILD-SNAPSHOT + org.springframework.cloud + spring-cloud-circuitbreaker + pom + 0.0.1.BUILD-SNAPSHOT - - org.springframework.cloud - spring-cloud-build - 2.2.0.BUILD-SNAPSHOT - - - - https://github.com/spring-cloud-incubator/spring-cloud-circuitbreaker - scm:git:git://github.com/spring-cloud-incubator/spring-cloud-circuitbreaker.git - scm:git:ssh://git@github.com/spring-cloud-incubator/spring-cloud-circuitbreaker.git - HEAD - - - - 3.6.1 - 2.10 - - 2.19.1 - jacoco - reuseReports - ${project.basedir}/../target/jacoco.exec - java - 2.2.0.BUILD-SNAPSHOT - 2.2.0.BUILD-SNAPSHOT + + org.springframework.cloud + spring-cloud-build + 2.2.0.BUILD-SNAPSHOT + + + + https://github.com/spring-cloud-incubator/spring-cloud-circuitbreaker + scm:git:git://github.com/spring-cloud-incubator/spring-cloud-circuitbreaker.git + scm:git:ssh://git@github.com/spring-cloud-incubator/spring-cloud-circuitbreaker.git + + HEAD + + + + 3.6.1 + 2.10 + + 2.19.1 + jacoco + reuseReports + ${project.basedir}/../target/jacoco.exec + java + 2.2.0.BUILD-SNAPSHOT + 2.2.0.BUILD-SNAPSHOT true true - - - - - org.springframework.cloud - spring-cloud-commons-dependencies - ${spring-cloud-commons.version} - pom - import - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - ${spring-cloud-netflix.version} - pom - import - - - org.springframework.cloud - spring-cloud-circuitbreaker-dependencies - ${project.version} - pom - import - - - org.springframework.cloud - spring-cloud-test-support - test - ${spring-cloud-commons.version} - - - - - spring-cloud-circuitbreaker-dependencies - spring-cloud-circuitbreaker-resilience4j - spring-cloud-circuitbreaker-commons - spring-cloud-starter-circuitbreaker - spring-cloud-circuitbreaker-hystrix - spring-cloud-circuitbreaker-sentinel - docs + + + + + org.springframework.cloud + spring-cloud-commons-dependencies + ${spring-cloud-commons.version} + pom + import + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + ${spring-cloud-netflix.version} + pom + import + + + org.springframework.cloud + spring-cloud-circuitbreaker-dependencies + ${project.version} + pom + import + + + org.springframework.cloud + spring-cloud-test-support + test + ${spring-cloud-commons.version} + + + + + spring-cloud-circuitbreaker-dependencies + spring-cloud-circuitbreaker-resilience4j + spring-cloud-circuitbreaker-commons + spring-cloud-starter-circuitbreaker + spring-cloud-circuitbreaker-hystrix + spring-cloud-circuitbreaker-sentinel + docs spring-cloud-circuitbreaker-spring-retry - - - - org.apache.maven.plugins - maven-eclipse-plugin - ${maven-eclipse-plugin.version} - - false - - - .settings/org.eclipse.jdt.ui.prefs - ${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.ui.prefs - - - .settings/org.eclipse.jdt.core.prefs - ${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.core.prefs - - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - + + + + org.apache.maven.plugins + maven-eclipse-plugin + ${maven-eclipse-plugin.version} + + false + + + .settings/org.eclipse.jdt.ui.prefs + ${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.ui.prefs + + + .settings/org.eclipse.jdt.core.prefs + ${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.core.prefs + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + io.spring.javaformat spring-javaformat-maven-plugin @@ -115,112 +116,112 @@ org.apache.maven.plugins maven-checkstyle-plugin - - - - - spring - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/libs-snapshot-local - - true - - - false - - - - 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 - - - false - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone-local - - false - - - - spring-releases - Spring Releases - https://repo.spring.io/libs-release-local - - 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} - - - - - - + + + + + spring + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/libs-snapshot-local + + true + + + false + + + + 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 + + + false + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone-local + + false + + + + spring-releases + Spring Releases + https://repo.spring.io/libs-release-local + + 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} + + + + + + diff --git a/spring-cloud-circuitbreaker-commons/pom.xml b/spring-cloud-circuitbreaker-commons/pom.xml index f430ecd..107b4ef 100644 --- a/spring-cloud-circuitbreaker-commons/pom.xml +++ b/spring-cloud-circuitbreaker-commons/pom.xml @@ -1,25 +1,25 @@ - - - spring-cloud-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - org.springframework.cloud - spring-cloud-circuitbreaker-commons - 0.0.1.BUILD-SNAPSHOT + org.springframework.cloud + spring-cloud-circuitbreaker-commons + 0.0.1.BUILD-SNAPSHOT - - - org.springframework.boot - spring-boot-starter-webflux - true - - + + + org.springframework.boot + spring-boot-starter-webflux + true + + - \ No newline at end of file + diff --git a/spring-cloud-circuitbreaker-dependencies/pom.xml b/spring-cloud-circuitbreaker-dependencies/pom.xml index c8b3f9a..ed1490a 100644 --- a/spring-cloud-circuitbreaker-dependencies/pom.xml +++ b/spring-cloud-circuitbreaker-dependencies/pom.xml @@ -1,156 +1,156 @@ - - 4.0.0 + + 4.0.0 - - spring-cloud-dependencies-parent - org.springframework.cloud - 2.2.0.BUILD-SNAPSHOT - - + + spring-cloud-dependencies-parent + org.springframework.cloud + 2.2.0.BUILD-SNAPSHOT + + - spring-cloud-circuitbreaker-dependencies - 0.0.1.BUILD-SNAPSHOT - pom - spring-cloud-circuitbreaker-dependencies - Spring Cloud Circuit Breaker Dependencies + spring-cloud-circuitbreaker-dependencies + 0.0.1.BUILD-SNAPSHOT + pom + spring-cloud-circuitbreaker-dependencies + Spring Cloud Circuit Breaker Dependencies - - 0.13.1 - 1.5.1 - + + 0.13.1 + 1.5.1 + - - - - io.github.resilience4j - resilience4j-circuitbreaker - ${resilience4j.version} - - - io.github.resilience4j - resilience4j-timelimiter - ${resilience4j.version} - - - io.github.resilience4j - resilience4j-reactor - ${resilience4j.version} - - - com.alibaba.csp - sentinel-core - ${sentinel.version} - - - com.alibaba.csp - sentinel-reactor-adapter - ${sentinel.version} - - - org.springframework.cloud - spring-cloud-circuitbreaker-resilience4j - ${project.version} - - - org.springframework.cloud - spring-cloud-circuitbreaker-hystrix - ${project.version} - + + + + io.github.resilience4j + resilience4j-circuitbreaker + ${resilience4j.version} + + + io.github.resilience4j + resilience4j-timelimiter + ${resilience4j.version} + + + io.github.resilience4j + resilience4j-reactor + ${resilience4j.version} + + + com.alibaba.csp + sentinel-core + ${sentinel.version} + + + com.alibaba.csp + sentinel-reactor-adapter + ${sentinel.version} + + + org.springframework.cloud + spring-cloud-circuitbreaker-resilience4j + ${project.version} + + + org.springframework.cloud + spring-cloud-circuitbreaker-hystrix + ${project.version} + org.springframework.cloud spring-cloud-circuitbreaker-spring-retry ${project.version} - - org.springframework.cloud - spring-cloud-circuitbreaker-sentinel - ${project.version} - - - org.springframework.cloud - spring-cloud-circuitbreaker-commons - ${project.version} - - - org.springframework.cloud - spring-cloud-starter-circuitbreaker-resilience4j - ${project.version} - + + org.springframework.cloud + spring-cloud-circuitbreaker-sentinel + ${project.version} + + + org.springframework.cloud + spring-cloud-circuitbreaker-commons + ${project.version} + + + org.springframework.cloud + spring-cloud-starter-circuitbreaker-resilience4j + ${project.version} + org.springframework.cloud spring-cloud-starter-circuitbreaker-reactor-resilience4j ${project.version} - - org.springframework.cloud - spring-cloud-starter-circuitbreaker-hystrix - ${project.version} - - - org.springframework.cloud - spring-cloud-starter-circuitbreaker-sentinel - ${project.version} - - - + + org.springframework.cloud + spring-cloud-starter-circuitbreaker-hystrix + ${project.version} + + + org.springframework.cloud + spring-cloud-starter-circuitbreaker-sentinel + ${project.version} + + + - - - spring - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/libs-snapshot-local - - true - - - false - - - - 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 - - - false - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone-local - - false - - - - - + + + spring + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/libs-snapshot-local + + true + + + false + + + + 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 + + + false + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone-local + + false + + + + + diff --git a/spring-cloud-circuitbreaker-hystrix/pom.xml b/spring-cloud-circuitbreaker-hystrix/pom.xml index ca80df0..e546817 100644 --- a/spring-cloud-circuitbreaker-hystrix/pom.xml +++ b/spring-cloud-circuitbreaker-hystrix/pom.xml @@ -1,48 +1,48 @@ - - - spring-cloud-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - org.springframework.cloud - spring-cloud-circuitbreaker-hystrix - 0.0.1.BUILD-SNAPSHOT + org.springframework.cloud + spring-cloud-circuitbreaker-hystrix + 0.0.1.BUILD-SNAPSHOT - - - org.springframework.cloud - spring-cloud-circuitbreaker-commons - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - - org.springframework.boot - spring-boot-starter-web - true - - - io.projectreactor - reactor-core - true - - - org.springframework.boot - spring-boot-starter-webflux - test - - - org.springframework.boot - spring-boot-starter-test - test - - + + + org.springframework.cloud + spring-cloud-circuitbreaker-commons + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + org.springframework.boot + spring-boot-starter-web + true + + + io.projectreactor + reactor-core + true + + + org.springframework.boot + spring-boot-starter-webflux + test + + + org.springframework.boot + spring-boot-starter-test + test + + - \ No newline at end of file + diff --git a/spring-cloud-circuitbreaker-resilience4j/pom.xml b/spring-cloud-circuitbreaker-resilience4j/pom.xml index f814b1a..8f38c15 100644 --- a/spring-cloud-circuitbreaker-resilience4j/pom.xml +++ b/spring-cloud-circuitbreaker-resilience4j/pom.xml @@ -1,64 +1,64 @@ - - - spring-cloud-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - .. - - 4.0.0 + + + spring-cloud-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + .. + + 4.0.0 - spring-cloud-circuitbreaker-resilience4j - 0.0.1.BUILD-SNAPSHOT - spring-cloud-circuitbreaker-resilience4j - Spring Cloud Resilience4J + spring-cloud-circuitbreaker-resilience4j + 0.0.1.BUILD-SNAPSHOT + spring-cloud-circuitbreaker-resilience4j + Spring Cloud Resilience4J - - - org.springframework.cloud - spring-cloud-circuitbreaker-commons - - - io.github.resilience4j - resilience4j-circuitbreaker - - - io.github.resilience4j - resilience4j-timelimiter - - - io.github.resilience4j - resilience4j-reactor - true - - - org.springframework.boot - spring-boot-starter-web - true - - - io.projectreactor - reactor-core - true - - - org.springframework.boot - spring-boot-starter-webflux - test - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test + + + org.springframework.cloud + spring-cloud-circuitbreaker-commons + + + io.github.resilience4j + resilience4j-circuitbreaker + + + io.github.resilience4j + resilience4j-timelimiter + + + io.github.resilience4j + resilience4j-reactor + true + + + org.springframework.boot + spring-boot-starter-web + true + + + io.projectreactor + reactor-core + true + + + org.springframework.boot + spring-boot-starter-webflux test - - + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + diff --git a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java index 7c72ece..eaf0d5f 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/main/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JAutoConfiguration.java @@ -33,8 +33,8 @@ import org.springframework.context.annotation.Configuration; * @author Ryan Baxter */ @Configuration -@ConditionalOnClass( - name = { "reactor.core.publisher.Mono", "reactor.core.publisher.Flux" }) +@ConditionalOnClass(name = { "reactor.core.publisher.Mono", "reactor.core.publisher.Flux", + "io.github.resilience4j.reactor.circuitbreaker.operator.CircuitBreakerOperator" }) public class ReactiveResilience4JAutoConfiguration { @Bean diff --git a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java index 42d268d..34c71b5 100644 --- a/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java +++ b/spring-cloud-circuitbreaker-resilience4j/src/test/java/org/springframework/cloud/circuitbreaker/resilience4j/ReactiveResilience4JCircuitBreakerIntegrationTest.java @@ -61,9 +61,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @DirtiesContext public class ReactiveResilience4JCircuitBreakerIntegrationTest { - @LocalServerPort - int port = 0; - @Mock static EventConsumer slowErrorConsumer; @@ -88,6 +85,9 @@ public class ReactiveResilience4JCircuitBreakerIntegrationTest { @Mock static EventConsumer normalFluxSuccessConsumer; + @LocalServerPort + int port = 0; + @Autowired ReactiveResilience4JCircuitBreakerIntegrationTest.Application.DemoControllerService service; diff --git a/spring-cloud-circuitbreaker-sentinel/pom.xml b/spring-cloud-circuitbreaker-sentinel/pom.xml index b5de5b1..62161d8 100644 --- a/spring-cloud-circuitbreaker-sentinel/pom.xml +++ b/spring-cloud-circuitbreaker-sentinel/pom.xml @@ -1,54 +1,54 @@ - - - spring-cloud-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - spring-cloud-circuitbreaker-sentinel + spring-cloud-circuitbreaker-sentinel - - - org.springframework.cloud - spring-cloud-circuitbreaker-commons - - - com.alibaba.csp - sentinel-core - - - com.alibaba.csp - sentinel-reactor-adapter - - - org.springframework.boot - spring-boot-starter-web - true - - - io.projectreactor - reactor-core - true - + + + org.springframework.cloud + spring-cloud-circuitbreaker-commons + + + com.alibaba.csp + sentinel-core + + + com.alibaba.csp + sentinel-reactor-adapter + + + org.springframework.boot + spring-boot-starter-web + true + + + io.projectreactor + reactor-core + true + - - org.springframework.boot - spring-boot-starter-webflux - test - - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-webflux + test + + + org.springframework.boot + spring-boot-starter-test + test + io.projectreactor reactor-test test - + diff --git a/spring-cloud-circuitbreaker-spring-retry/pom.xml b/spring-cloud-circuitbreaker-spring-retry/pom.xml index a7932f4..48a11d3 100644 --- a/spring-cloud-circuitbreaker-spring-retry/pom.xml +++ b/spring-cloud-circuitbreaker-spring-retry/pom.xml @@ -1,6 +1,6 @@ - spring-cloud-circuitbreaker diff --git a/spring-cloud-circuitbreaker-spring-retry/src/test/resources/logback-test.xml b/spring-cloud-circuitbreaker-spring-retry/src/test/resources/logback-test.xml index 2e66505..f3fa67b 100644 --- a/spring-cloud-circuitbreaker-spring-retry/src/test/resources/logback-test.xml +++ b/spring-cloud-circuitbreaker-spring-retry/src/test/resources/logback-test.xml @@ -1,5 +1,5 @@ - + diff --git a/spring-cloud-starter-circuitbreaker/pom.xml b/spring-cloud-starter-circuitbreaker/pom.xml index 5848a7e..0c72892 100644 --- a/spring-cloud-starter-circuitbreaker/pom.xml +++ b/spring-cloud-starter-circuitbreaker/pom.xml @@ -1,25 +1,25 @@ - - - spring-cloud-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - org.springframework.cloud - spring-cloud-starter-circuitbreaker - 0.0.1.BUILD-SNAPSHOT - - spring-cloud-starter-circuitbreaker-resilience4j - spring-cloud-starter-circuitbreaker-hystrix - spring-cloud-starter-circuitbreaker-sentinel + org.springframework.cloud + spring-cloud-starter-circuitbreaker + 0.0.1.BUILD-SNAPSHOT + + spring-cloud-starter-circuitbreaker-resilience4j + spring-cloud-starter-circuitbreaker-hystrix + spring-cloud-starter-circuitbreaker-sentinel spring-cloud-starter-circuitbreaker-spring-retry spring-cloud-starter-circuitbreaker-reactor-resilience4j - pom + pom diff --git a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-hystrix/pom.xml b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-hystrix/pom.xml index c45de73..99a9f22 100644 --- a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-hystrix/pom.xml +++ b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-hystrix/pom.xml @@ -1,28 +1,28 @@ - - - spring-cloud-starter-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-starter-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - spring-cloud-starter-circuitbreaker-hystrix + spring-cloud-starter-circuitbreaker-hystrix - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.cloud - spring-cloud-circuitbreaker-hystrix - - - org.springframework.cloud - spring-cloud-starter-netflix-hystrix - - + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-circuitbreaker-hystrix + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + diff --git a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-reactor-resilience4j/pom.xml b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-reactor-resilience4j/pom.xml index 3333336..8a965ad 100644 --- a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-reactor-resilience4j/pom.xml +++ b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-reactor-resilience4j/pom.xml @@ -1,6 +1,6 @@ - spring-cloud-starter-circuitbreaker diff --git a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-resilience4j/pom.xml b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-resilience4j/pom.xml index 8f2f698..1884375 100644 --- a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-resilience4j/pom.xml +++ b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-resilience4j/pom.xml @@ -1,34 +1,34 @@ - - - spring-cloud-starter-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-starter-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - org.springframework.cloud - spring-cloud-starter-circuitbreaker-resilience4j - 0.0.1.BUILD-SNAPSHOT + org.springframework.cloud + spring-cloud-starter-circuitbreaker-resilience4j + 0.0.1.BUILD-SNAPSHOT - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.cloud - spring-cloud-circuitbreaker-resilience4j - - - io.github.resilience4j - resilience4j-circuitbreaker - - - io.github.resilience4j - resilience4j-timelimiter - - + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-circuitbreaker-resilience4j + + + io.github.resilience4j + resilience4j-circuitbreaker + + + io.github.resilience4j + resilience4j-timelimiter + + diff --git a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-sentinel/pom.xml b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-sentinel/pom.xml index 3c00eba..3dabdf5 100644 --- a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-sentinel/pom.xml +++ b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-sentinel/pom.xml @@ -1,24 +1,24 @@ - - - spring-cloud-starter-circuitbreaker - org.springframework.cloud - 0.0.1.BUILD-SNAPSHOT - - 4.0.0 + + + spring-cloud-starter-circuitbreaker + org.springframework.cloud + 0.0.1.BUILD-SNAPSHOT + + 4.0.0 - spring-cloud-starter-circuitbreaker-sentinel + spring-cloud-starter-circuitbreaker-sentinel - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.cloud - spring-cloud-circuitbreaker-sentinel - - - \ No newline at end of file + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.cloud + spring-cloud-circuitbreaker-sentinel + + + diff --git a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-spring-retry/pom.xml b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-spring-retry/pom.xml index 62bc464..06ae5a9 100644 --- a/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-spring-retry/pom.xml +++ b/spring-cloud-starter-circuitbreaker/spring-cloud-starter-circuitbreaker-spring-retry/pom.xml @@ -1,6 +1,6 @@ - spring-cloud-starter-circuitbreaker