From 2f765faab03dd7eb1d7da260978a262846b43091 Mon Sep 17 00:00:00 2001 From: Raffaele Litto Date: Thu, 4 Jan 2018 23:34:33 +0000 Subject: [PATCH 01/11] #186 Feature: circuitBreaker reset --- gradle/wrapper/gradle-wrapper.jar | Bin 54208 -> 54224 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 11 +- gradlew.bat | 168 +++++++++++------------ 4 files changed, 91 insertions(+), 92 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 421fe971ff689ae94bbcdf6b616bff675eaca52e..d6e2637affb74a80bfbe87bd2da57e81b2f3c661 100644 GIT binary patch delta 4771 zcmZ`+2{@E(7k9Pzqn!Vr1Xj zPzg~)pHj$|`k!~w=Y946&viXBbFOorbMAAV1R0yUez7fwb@%0+M+;rDmT64qHmj(RecoF5TD(a=y9@tcJTCK zWoj}-U3XJAkFTb6ny3oNc%ZQk_e#JvKA~(_S;g=0#^>!4Pm7jB^>Axj9r9hiefgx^ zCaLy(z5AqgAGuQUFtokgMzwsdCq~xo@s)k0TpwHrjTcQ965NKz6q8JFY@L``qQPmC}m3i39i5OK9@D_cd*Znb?`V z%UJaqeFG=is?=J1N1{QGaCIgGnxpSQse`|_BBOEm9i;L1PSK(S7j&J zowycUo8|1-VtIS(Xkwj?V1>&%j;61ds$|R@g>r62*LtsuLm(V*=Or!-$TvEXc~hpD+rFGnxE1%*D%lly45JlCC?)?6Q}N#mQHw zslC`WOW2#KeT)5Oh{fV7{nG7rSEWfMH?W9tPscFitLu4Ks-{INq7jI1! z&dtAylPV4C`H`HnGjYC|s$^x)Q71ZLlW{j{TZxVBiDxhJrQgg&WP4r>?e|(Vn7Ysy z{3ftx_S+{k9^cxcs^cV-XK;rWxxY*bkN}^#Rk;~vz*ai0*zCv#**JbaZ-Xu56 zjv1!eb4q6;&KiZ?Q=bXU5@vgO{-Jnje1!_lGVdl!m;bSFM&UD;{z~yA_$<98zjGK2 z<;@QM%D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SF`u8A*AA;k0WEFq*5{n%Py3YVtC2E*G0{saI NuIS-qzxN3F|Nnfx1YrOG diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 581f92de70..b5a15cd461 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jan 09 12:41:44 CET 2017 +#Thu Jan 04 14:19:08 GMT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip diff --git a/gradlew b/gradlew index 4453ccea33..4ef3a871f2 100755 --- a/gradlew +++ b/gradlew @@ -155,14 +155,13 @@ if $cygwin ; then fi # Escape application args -save ( ) { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") +for s in "${@}" ; do + s=\"$s\" + APP_ARGS=$APP_ARGS" "$s +done # Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then diff --git a/gradlew.bat b/gradlew.bat index f9553162f1..e95643d6a2 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,84 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From b4c13a0e129468ea4f6cb8d3987032ebdbb20f3d Mon Sep 17 00:00:00 2001 From: Raffaele Litto Date: Thu, 4 Jan 2018 23:34:49 +0000 Subject: [PATCH 02/11] Revert "#186 Feature: circuitBreaker reset" This reverts commit 651dec6b176d52f1cdd3bdf32d7da34c81f80e2c. --- gradle/wrapper/gradle-wrapper.jar | Bin 54224 -> 54208 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 11 +- gradlew.bat | 168 +++++++++++------------ 4 files changed, 92 insertions(+), 91 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d6e2637affb74a80bfbe87bd2da57e81b2f3c661..421fe971ff689ae94bbcdf6b616bff675eaca52e 100644 GIT binary patch delta 4749 zcmZ`*2{@G78~>PW6S5m)M7BZ`QQ49tC89)$XlxmSE5=nSOjNoE@hM9v6y0QBv*l*r zw-zO9H;EMacav2A^G)dcxc5BIndf`wyuaVOob#UZc4pwJGjO~Ijd81lAc&I_!u!b> zMe$1V{*s=~2Y!muw$hlPPt#eTUz*>}$rwRkup&QTtOD~SovMsmrW4h=4*!!4K}3C4 zKuHCPEI2Nd46EaZP-4Nl)zTblI3P>}Kd5crU0(Mw+ zznJ*6&ST_=W;VQ2ZhdjIh+&k;-L!hWki^nFhwS_+V_YL!)FFRe;If(`2BN( zE{jGe<*hI24zHhp=wp?vVMdtNh_7kQl?YiQ*O?0I%FYPUC-ZVXAESwz?hT*VdX(tg zXLh6|G~&2nQu-!ZoLfUhgoKeFhr2{<-YpN3#NpD(shCP@?W&htl0FhFM6K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GATf-oj4m)mvSWsonh6_Ft59X;Re zC<5@pU}7uy_YwGbi|p@eBlixrg`k6&JA;NIOkO$12pj=`TZ2Bhm%kwhIXVk)UCTPO zXX75XsRV#c12>H7zfk00$hg4beq>mtl^2b79~7eXH&a5vK_!5Ls);f1^oK?Kwc+sge~%MAdR#jaT{jRUBn)!}aw7mV zgP;u~)=uDz3W3{C3*+#55FB4C2n%UieX$0y_BK?QEocu;BCH=GDd&r=XA?JiKuI zA4_D=LmZz3j6*?1u|`G3bfcVZF$~+zZiMa3UAmI9hlo)s^dL&(`#?#C{d(4;>6O=& z`XvK;1%RFohMsCA9nW1!{DaNUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 0401b33be70fcbfa1a20a92d474debbaa05d4b49 Mon Sep 17 00:00:00 2001 From: Raffaele Litto Date: Tue, 16 Jan 2018 10:59:19 +0000 Subject: [PATCH 03/11] #159 added new states, missing tests --- .../circuitbreaker/CircuitBreaker.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java index 2aebdf3971..40e81a8fe8 100644 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java @@ -88,6 +88,22 @@ public interface CircuitBreaker { void onSuccess(long durationInNanos); + /** + * Transitions the state machine to a DISABLED state, stopping state transition, metrics and event publishing. + * + * Should only be used, when you want to disable the circuit breaker allowing all calls to pass. + * To recover from this state you must force a new state transition + */ + void disable(); + + /** + * Transitions the state machine to a FORCED_OPEN state, stopping state transition, metrics and event publishing. + * + * Should only be used, when you want to disable the circuit breaker allowing no call to pass. + * To recover from this state you must force a new state transition + */ + void forceOpen(); + /** * Returns the circuit breaker to its original closed state, losing statistics. * From 22fdfabe8ccce28995663acfba3777c91ef9ca63 Mon Sep 17 00:00:00 2001 From: Raffaele Litto Date: Tue, 16 Jan 2018 11:02:20 +0000 Subject: [PATCH 04/11] #159 adding states missed add #159 adding states part 2 --- .../event/CircuitBreakerOnDisabledEvent.java | 42 +++++++++++++++++++ .../CircuitBreakerOnForcedOpenEvent.java | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java create mode 100644 resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java new file mode 100644 index 0000000000..cc3f9c29f9 --- /dev/null +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java @@ -0,0 +1,42 @@ +/* + * + * Copyright 2016 Robert Winkler + * + * 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. + * + * + */ +package io.github.resilience4j.circuitbreaker.event; + +/** + * A CircuitBreakerEvent which informs about a reset. + */ +public class CircuitBreakerOnDisabledEvent extends AbstractCircuitBreakerEvent{ + + public CircuitBreakerOnDisabledEvent(String circuitBreakerName) { + super(circuitBreakerName); + } + + @Override + public Type getEventType() { + return Type.DISABLED; + } + + @Override + public String toString(){ + return String.format("%s: CircuitBreaker '%s' disabled", + getCreationTime(), + getCircuitBreakerName()); + + } +} diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java new file mode 100644 index 0000000000..f7b46ecc6f --- /dev/null +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java @@ -0,0 +1,42 @@ +/* + * + * Copyright 2016 Robert Winkler + * + * 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. + * + * + */ +package io.github.resilience4j.circuitbreaker.event; + +/** + * A CircuitBreakerEvent which informs about a reset. + */ +public class CircuitBreakerOnForcedOpenEvent extends AbstractCircuitBreakerEvent{ + + public CircuitBreakerOnForcedOpenEvent(String circuitBreakerName) { + super(circuitBreakerName); + } + + @Override + public Type getEventType() { + return Type.FORCED_OPEN; + } + + @Override + public String toString(){ + return String.format("%s: CircuitBreaker '%s' forced open", + getCreationTime(), + getCircuitBreakerName()); + + } +} From 6060c833bfd1f70719a971bbfe5b50b690dbf002 Mon Sep 17 00:00:00 2001 From: rLitto Date: Tue, 16 Jan 2018 12:29:20 +0000 Subject: [PATCH 05/11] #159 changes in names Changing method names, removing unnecessary events and listeners --- .../circuitbreaker/CircuitBreaker.java | 16 ------- .../event/CircuitBreakerOnDisabledEvent.java | 42 ------------------- .../CircuitBreakerOnForcedOpenEvent.java | 42 ------------------- 3 files changed, 100 deletions(-) delete mode 100644 resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java delete mode 100644 resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java index 40e81a8fe8..2aebdf3971 100644 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java @@ -88,22 +88,6 @@ public interface CircuitBreaker { void onSuccess(long durationInNanos); - /** - * Transitions the state machine to a DISABLED state, stopping state transition, metrics and event publishing. - * - * Should only be used, when you want to disable the circuit breaker allowing all calls to pass. - * To recover from this state you must force a new state transition - */ - void disable(); - - /** - * Transitions the state machine to a FORCED_OPEN state, stopping state transition, metrics and event publishing. - * - * Should only be used, when you want to disable the circuit breaker allowing no call to pass. - * To recover from this state you must force a new state transition - */ - void forceOpen(); - /** * Returns the circuit breaker to its original closed state, losing statistics. * diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java deleted file mode 100644 index cc3f9c29f9..0000000000 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnDisabledEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * Copyright 2016 Robert Winkler - * - * 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. - * - * - */ -package io.github.resilience4j.circuitbreaker.event; - -/** - * A CircuitBreakerEvent which informs about a reset. - */ -public class CircuitBreakerOnDisabledEvent extends AbstractCircuitBreakerEvent{ - - public CircuitBreakerOnDisabledEvent(String circuitBreakerName) { - super(circuitBreakerName); - } - - @Override - public Type getEventType() { - return Type.DISABLED; - } - - @Override - public String toString(){ - return String.format("%s: CircuitBreaker '%s' disabled", - getCreationTime(), - getCircuitBreakerName()); - - } -} diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java deleted file mode 100644 index f7b46ecc6f..0000000000 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/event/CircuitBreakerOnForcedOpenEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * Copyright 2016 Robert Winkler - * - * 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. - * - * - */ -package io.github.resilience4j.circuitbreaker.event; - -/** - * A CircuitBreakerEvent which informs about a reset. - */ -public class CircuitBreakerOnForcedOpenEvent extends AbstractCircuitBreakerEvent{ - - public CircuitBreakerOnForcedOpenEvent(String circuitBreakerName) { - super(circuitBreakerName); - } - - @Override - public Type getEventType() { - return Type.FORCED_OPEN; - } - - @Override - public String toString(){ - return String.format("%s: CircuitBreaker '%s' forced open", - getCreationTime(), - getCircuitBreakerName()); - - } -} From ef9a5a573a97e6303b3d91e5400e171ed7e43fc9 Mon Sep 17 00:00:00 2001 From: rLitto Date: Tue, 16 Jan 2018 23:35:47 +0000 Subject: [PATCH 06/11] #159 Testing State, Metrics and Event Publishing. Added mechanism for Event and State publishing check --- gradle/wrapper/gradle-wrapper.jar | Bin 54208 -> 54224 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 11 +- gradlew.bat | 168 +++++++++++------------ 4 files changed, 91 insertions(+), 92 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 421fe971ff689ae94bbcdf6b616bff675eaca52e..d6e2637affb74a80bfbe87bd2da57e81b2f3c661 100644 GIT binary patch delta 4771 zcmZ`+2{@E(7k9Pzqn!Vr1Xj zPzg~)pHj$|`k!~w=Y946&viXBbFOorbMAAV1R0yUez7fwb@%0+M+;rDmT64qHmj(RecoF5TD(a=y9@tcJTCK zWoj}-U3XJAkFTb6ny3oNc%ZQk_e#JvKA~(_S;g=0#^>!4Pm7jB^>Axj9r9hiefgx^ zCaLy(z5AqgAGuQUFtokgMzwsdCq~xo@s)k0TpwHrjTcQ965NKz6q8JFY@L``qQPmC}m3i39i5OK9@D_cd*Znb?`V z%UJaqeFG=is?=J1N1{QGaCIgGnxpSQse`|_BBOEm9i;L1PSK(S7j&J zowycUo8|1-VtIS(Xkwj?V1>&%j;61ds$|R@g>r62*LtsuLm(V*=Or!-$TvEXc~hpD+rFGnxE1%*D%lly45JlCC?)?6Q}N#mQHw zslC`WOW2#KeT)5Oh{fV7{nG7rSEWfMH?W9tPscFitLu4Ks-{INq7jI1! z&dtAylPV4C`H`HnGjYC|s$^x)Q71ZLlW{j{TZxVBiDxhJrQgg&WP4r>?e|(Vn7Ysy z{3ftx_S+{k9^cxcs^cV-XK;rWxxY*bkN}^#Rk;~vz*ai0*zCv#**JbaZ-Xu56 zjv1!eb4q6;&KiZ?Q=bXU5@vgO{-Jnje1!_lGVdl!m;bSFM&UD;{z~yA_$<98zjGK2 z<;@QM%DvIkdx2qWh^hVn?hfm7qv8*lVYnXdGKinQ%-i&K-Trweu(8)^oy$(4Ib97@UmE=a0+;@L5jGZhp3kwCdl zYyFY*U@^K;eB=bkz`UbhahccZTN&NRH? zi}RfP_%^stm?u@y`L>>BhS(!kem<*Ac*a{`C#}}ZPQKI1fAj6GBTq_H7O8KpS@0GS z?;m54v!-x-G&|;=W>em&V&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K$ih`bOa zzodnHz&W+b>rtH8ZWgVoE3nYpN^M-823IN9tA#8ObOZ-M8fXl}A_k(8hQAXC@U1#F zOk}xrNMx(UnXLO8xZv?R3A86pXIlrOfrbv)Y!wWty95(sBOw9X)niFL>k-oZ(m+83 z){*9gbC)SpGZpL`%SI|T@m!a!Yg0aOImYUGzk z?OsWU-9#!Lf)oj0V)ScZuSQjj-`S0b-&wXy7X}+8(YbHsIldoH0DQf|M1SU3nDvt2^CPk+OXOVjf;ax1~HHfe@A{~F0+d}a;y3;TP zgn;*UIlqer=tNM;YD+-mqskG!)usF|2}NL(H9NY~08D{nIV{B)o;oQ5@1qJ}flm0D z5T}=h7#(p#ZS%_WfZ!6{Z8|bQp{3)N7aE&4h*|-*Z53JEWTq1VtpuRT3dgtZLfc=z z%8*+O@KBLdEZIgro}OYxw6;wM!=uxN1hdT-F89@0k)OXEo~$1ROdcSq$W{AmeDFh} zfn)vGt^i%SQz%LmfS`JCPO(WPp9di6|JXoXQI{VLz|Lh*6*|8Rfv?_ZrmgcZX@xBq z(vJ57;m!jmH8G&M1ekF{dj()mG3RF;kho@W_h@4PZHY`Pz8#W_b;rzeQiX5@AeREC zWFto35w7gmf=T6k2a-x!8vH(O1H7|y>HcE!9PC6E^)i`8B0Htfo2K6-GCB^N@&hl; zc8n4IY^MH1wz$&rV@MWu3E}{rl>=H;4Cpef+ogr(uefibiWL0?5Ck^01BKvl?Z!m$ zp$l=exrBM@d`m@Eq;O1z=i^?Gb7R1`8DqGz40ua|kC%(C0Fm58^4b8P58ONI7?61d z)6)0urOTI@ueCjh8$J)gxfFxVdn7SF`u8A*AA;k0WEFq*5{n%Py3YVtC2E*G0{saI NuIS-qzxN3F|Nnfx1YrOG diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 581f92de70..47f90cfb24 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jan 09 12:41:44 CET 2017 +#Tue Jan 16 22:35:50 GMT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip diff --git a/gradlew b/gradlew index 4453ccea33..4ef3a871f2 100755 --- a/gradlew +++ b/gradlew @@ -155,14 +155,13 @@ if $cygwin ; then fi # Escape application args -save ( ) { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") +for s in "${@}" ; do + s=\"$s\" + APP_ARGS=$APP_ARGS" "$s +done # Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then diff --git a/gradlew.bat b/gradlew.bat index f9553162f1..e95643d6a2 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,84 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 430cc4e647a38da9fc5156e9d068da4619f2e26c Mon Sep 17 00:00:00 2001 From: rLitto Date: Tue, 16 Jan 2018 23:40:02 +0000 Subject: [PATCH 07/11] #159 reverting gradle files committed as an error --- gradle/wrapper/gradle-wrapper.jar | Bin 54224 -> 54208 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 11 +- gradlew.bat | 168 +++++++++++------------ 4 files changed, 92 insertions(+), 91 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d6e2637affb74a80bfbe87bd2da57e81b2f3c661..421fe971ff689ae94bbcdf6b616bff675eaca52e 100644 GIT binary patch delta 4749 zcmZ`*2{@G78~>PW6S5m)M7BZ`QQ49tC89)$XlxmSE5=nSOjNoE@hM9v6y0QBv*l*r zw-zO9H;EMacav2A^G)dcxc5BIndf`wyuaVOob#UZc4pwJGjO~Ijd81lAc&I_!u!b> zMe$1V{*s=~2Y!muw$hlPPt#eTUz*>}$rwRkup&QTtOD~SovMsmrW4h=4*!!4K}3C4 zKuHCPEI2Nd46EaZP-4Nl)zTblI3P>}Kd5crU0(Mw+ zznJ*6&ST_=W;VQ2ZhdjIh+&k;-L!hWki^nFhwS_+V_YL!)FFRe;If(`2BN( zE{jGe<*hI24zHhp=wp?vVMdtNh_7kQl?YiQ*O?0I%FYPUC-ZVXAESwz?hT*VdX(tg zXLh6|G~&2nQu-!ZoLfUhgoKeFhr2{<-YpN3#NpD(shCP@?W&htl0FhFM6K*0SJv^I zH?=)UrNIU~l&-16JQTq(a&pVf2O7sWBv)wo*!xvXCGMn5=lj$(Yh7n($0p(Z`jW)? z$C}T1=;Xe%dqF22x+RmF+3mJU(1*p0Z!G&vgt;f~EhUfS6Gtkt)z;W_)ld{4PYd)N z$UK;r;Zpw5JxxpLTlCfm!`B^3$Jz^D_qh&gUE!G7mgN+dtQ(s&lNBmcVCkQE1P=J; z@1p#kyM2~_mrge3(XF0NFa)o=we7pP6F%ZArE)!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z3j6*?1u|`G3bfcVZF$~+zZiMa3UAmI9hlo)s^dL&(`#?#C{d(4;>6O=& z`XvK;1%RFohMsCA9nW1!{DaNUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 24e59d3f20f51f3cbfc2d80ec173a8919d196920 Mon Sep 17 00:00:00 2001 From: rLitto Date: Tue, 16 Jan 2018 23:54:36 +0000 Subject: [PATCH 08/11] #159 fixed CR from codacy --- .../io/github/resilience4j/circuitbreaker/CircuitBreaker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java index 2aebdf3971..c27727fe69 100644 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java @@ -291,6 +291,10 @@ private boolean matches(State fromState, State toState) { return this.fromState == fromState && this.toState == toState; } + private boolean matches(State fromState, State toState) { + return this.fromState == fromState && this.toState == toState; + } + public static StateTransition transitionBetween(State fromState, State toState){ final StateTransition stateTransition = STATE_TRANSITION_MAP.get(Tuple.of(fromState, toState)); if(stateTransition == null) { From a746bd5a2b59f9d068fc46a6da9011c97bb9f97c Mon Sep 17 00:00:00 2001 From: rLitto Date: Wed, 17 Jan 2018 13:25:58 +0000 Subject: [PATCH 09/11] #159 Adding some documentation --- .../io/github/resilience4j/circuitbreaker/CircuitBreaker.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java index c27727fe69..2aebdf3971 100644 --- a/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java +++ b/resilience4j-circuitbreaker/src/main/java/io/github/resilience4j/circuitbreaker/CircuitBreaker.java @@ -291,10 +291,6 @@ private boolean matches(State fromState, State toState) { return this.fromState == fromState && this.toState == toState; } - private boolean matches(State fromState, State toState) { - return this.fromState == fromState && this.toState == toState; - } - public static StateTransition transitionBetween(State fromState, State toState){ final StateTransition stateTransition = STATE_TRANSITION_MAP.get(Tuple.of(fromState, toState)); if(stateTransition == null) { From a206bb9e19044c759162bdeaf374afeb43e192db Mon Sep 17 00:00:00 2001 From: rLitto Date: Mon, 29 Jan 2018 12:56:12 +0000 Subject: [PATCH 10/11] 159 fixed test after metrics change --- .../CircuitBreakerStateMachineTest.java | 92 +++++++++---------- 1 file changed, 43 insertions(+), 49 deletions(-) diff --git a/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java b/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java index 624bbd9edf..173222f981 100644 --- a/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java +++ b/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java @@ -27,12 +27,13 @@ import static java.lang.Thread.sleep; import static org.assertj.core.api.BDDAssertions.assertThat; + public class CircuitBreakerStateMachineTest { private CircuitBreaker circuitBreaker; @Before - public void setUp(){ + public void setUp() { circuitBreaker = new CircuitBreakerStateMachine("testName", CircuitBreakerConfig.custom() .failureRateThreshold(50) .ringBufferSizeInClosedState(5) @@ -59,33 +60,25 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (1) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 1, null, 1, 0L); // Call 2 is a failure circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (2) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(2); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(2); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 2, null, 2, 0L); // Call 3 is a failure circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (3) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(3); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(3); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 3, null, 3, 0L); // Call 4 is a success circuitBreaker.onSuccess(0); // Should create a CircuitBreakerOnSuccessEvent (4) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(4); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(3); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 4, null, 3, 0L); // Call 5 is a success circuitBreaker.onSuccess(0); // Should create a CircuitBreakerOnSuccessEvent (5) @@ -94,6 +87,7 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(5); assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(3); assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(60.0f); + assertCircuitBreakerMetricsEqualTo(60.0f, null, 5, null, 3, 0L); sleep(500); @@ -109,21 +103,16 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { // The CircuitBreaker switches to half open, because the wait duration of 1 second is elapsed assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.HALF_OPEN); // Should create a CircuitBreakerOnStateTransitionEvent (9) - // Metrics are reseted - assertThat(circuitBreaker.getMetrics().getMaxNumberOfBufferedCalls()).isEqualTo(3); - assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(0); + // Metrics are resetted assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(0); + assertCircuitBreakerMetricsEqualTo(-1f, null, 0, 3, 0, 0L); // A ring buffer with size 2 is used in half open state // Call 1 is a failure circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (10) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.HALF_OPEN); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 1, null, 1, 0L); // Call 2 is a failure circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (11) @@ -146,16 +135,12 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { // Call 1 is a failure circuitBreaker.onError(0, new RuntimeException()); // Should create a CircuitBreakerOnErrorEvent (15) assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.HALF_OPEN); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 1, null, 1, null); // Call 2 should be ignored, because it's a NumberFormatException circuitBreaker.onError(0, new NumberFormatException()); // Should create a CircuitBreakerOnIgnoredErrorEvent (16) assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.HALF_OPEN); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 1, null, 1, null); // Call 3 is a success circuitBreaker.onSuccess(0); // Should create a CircuitBreakerOnSuccessEvent (17) @@ -166,10 +151,7 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { // The state machine transitions back to CLOSED state assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); // Should create a CircuitBreakerOnStateTransitionEvent (19) - assertThat(circuitBreaker.getMetrics().getMaxNumberOfBufferedCalls()).isEqualTo(5); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(3); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); + assertCircuitBreakerMetricsEqualTo(-1f, null, 3, 5, 1, 0L); circuitBreaker.reset(); // Should create a CircuitBreakerOnResetEvent (20) @@ -202,14 +184,9 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { assertThat(circuitBreaker.isCallPermitted()).isEqualTo(true); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); assertThatMetricsAreReset(); - assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); circuitBreaker.onSuccess(0); // Should create a CircuitBreakerOnSuccessEvent (23) - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(1); + assertCircuitBreakerMetricsEqualTo(-1f, 1, 1, null, 0, 0L); circuitBreaker.transitionToForcedOpenState(); // Should create a CircuitBreakerOnStateTransitionEvent (20) @@ -217,8 +194,7 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { // The state machine transitions back to CLOSED state assertThat(circuitBreaker.isCallPermitted()).isEqualTo(false); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.FORCED_OPEN); // Should create a CircuitBreakerOnStateTransitionEvent (21) - assertThatMetricsAreReset(); - assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); + assertCircuitBreakerMetricsEqualTo(-1f, 0, 0, null, 0, 1L); circuitBreaker.onSuccess(0); // Should not create a CircuitBreakerOnSuccessEvent circuitBreaker.onSuccess(0); // Should not create a CircuitBreakerOnSuccessEvent @@ -227,23 +203,41 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { assertThat(circuitBreaker.isCallPermitted()).isEqualTo(false); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.FORCED_OPEN); // Should create a CircuitBreakerOnStateTransitionEvent (21) - assertThatMetricsAreReset(); + final CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics(); + assertCircuitBreakerMetricsEqualTo(-1f, null, 0, null, 0, 2L); + circuitBreaker.transitionToOpenState(); // Should create a CircuitBreakerOnStateTransitionEvent (20) assertThat(circuitBreaker.isCallPermitted()).isEqualTo(false); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.OPEN); - assertThat(circuitBreaker.getMetrics().getFailureRate()).isEqualTo(-1f); - assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(0); - assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(1); + assertCircuitBreakerMetricsEqualTo(-1f, null, 0, null, 0, 3L); } - private void assertThatMetricsAreReset() { + private void assertCircuitBreakerMetricsEqualTo(Float expectedFailureRate, Integer expectedSuccessCalls, Integer expectedBufferedCalls, Integer expectedMaxBufferedCalls, Integer expectedFailedCalls, Long expectedNotPermittedCalls) { final CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics(); - assertThat(metrics.getFailureRate()).isEqualTo(-1f); - assertThat(metrics.getNumberOfBufferedCalls()).isEqualTo(0); - assertThat(metrics.getNumberOfFailedCalls()).isEqualTo(0); - assertThat(metrics.getNumberOfNotPermittedCalls()).isEqualTo(0); + if (expectedFailureRate != null) { + assertThat(metrics.getFailureRate()).isEqualTo(expectedFailureRate); + } + if (expectedSuccessCalls != null) { + assertThat(metrics.getNumberOfSuccessfulCalls()).isEqualTo(expectedSuccessCalls); + } + if (expectedBufferedCalls != null) { + assertThat(metrics.getNumberOfBufferedCalls()).isEqualTo(expectedBufferedCalls); + } + if (expectedMaxBufferedCalls != null) { + assertThat(metrics.getMaxNumberOfBufferedCalls()).isEqualTo(expectedMaxBufferedCalls); + } + if (expectedFailedCalls != null) { + assertThat(metrics.getNumberOfFailedCalls()).isEqualTo(expectedFailedCalls); + } + if (expectedNotPermittedCalls != null) { + assertThat(metrics.getNumberOfNotPermittedCalls()).isEqualTo(expectedNotPermittedCalls); + } } + + private void assertThatMetricsAreReset() { + assertCircuitBreakerMetricsEqualTo(-1f, 0, 0, null, 0, 0L); + } + } From 8b98bba60e04561929cae73100c0539a8689bb57 Mon Sep 17 00:00:00 2001 From: rLitto Date: Tue, 30 Jan 2018 17:45:05 +0000 Subject: [PATCH 11/11] #194 fixing Codacy issue --- .../circuitbreaker/internal/CircuitBreakerStateMachineTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java b/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java index 173222f981..190cff451e 100644 --- a/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java +++ b/resilience4j-circuitbreaker/src/test/java/io/github/resilience4j/circuitbreaker/internal/CircuitBreakerStateMachineTest.java @@ -203,7 +203,6 @@ public void testCircuitBreakerStateMachine() throws InterruptedException { assertThat(circuitBreaker.isCallPermitted()).isEqualTo(false); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.FORCED_OPEN); // Should create a CircuitBreakerOnStateTransitionEvent (21) - final CircuitBreaker.Metrics metrics = circuitBreaker.getMetrics(); assertCircuitBreakerMetricsEqualTo(-1f, null, 0, null, 0, 2L);