This is an automated email from the ASF dual-hosted git repository. radcortez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git
commit afbbf72677925cf2874fc576ad003b0f6ecc67f0 Author: josehenriqueventura <jose.vent...@protonmail.com> AuthorDate: Sat Jan 26 21:52:00 2019 +0000 Improvement of README.adoc which had things related with a .md file format. --- examples/mp-faulttolerance-timeout/README.adoc | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/examples/mp-faulttolerance-timeout/README.adoc b/examples/mp-faulttolerance-timeout/README.adoc index f4bfc36..c54fcf6 100644 --- a/examples/mp-faulttolerance-timeout/README.adoc +++ b/examples/mp-faulttolerance-timeout/README.adoc @@ -5,10 +5,11 @@ This is an example of how to use Microprofile @Timeout in TomEE. +[discrete] == Timeout Feature Fault Tolerance Timeout allow to specify how long a task can take to complete its execution and aborting it -in case of timeout. Timeout feature can be used along with another annotations to guide the execution and result of a task. +in case of timeout. Timeout feature can be used along with other annotations to guide the execution and result of a task. + Check the https://download.eclipse.org/microprofile/microprofile-fault-tolerance-1.1/microprofile-fault-tolerance-spec.html#_timeout_usage[specification] for more details. @@ -18,19 +19,22 @@ Timeout annotation allows to configure : * *value:* the timeout value * *unit:* the timeout unit -== Examples +[discrete] +== Example +[discrete] === Run the application .... mvn clean install tomee:run .... -=== Example 1 +[discrete] +=== How does it works? -The method `statusOfDayByAccuWeather` fails when threshold of `@Timeout` annotation is reached due to a long execution of -`longProcessingTask` method. To respond the request nicely, a fallback method will be activated to complete the request -successfully by the annotation `@Fallback`. +The method `statusOfDayByAccuWeather` fails when the threshold of `@Timeout` annotation is reached due to a long execution of +`longProcessingTask` method. To respond to the request nicely, a fallback method will take place to complete the request +successfully. The fallback method is determined by @Fallback annotation. [source,java] ---- @@ -70,29 +74,33 @@ GET http://localhost:8080/mp-faulttolerance-retry/weather/day/status Server log -.... +[source,text] +---- WARNING AccuWeather task has been interrupted. -WARNING MetEireann backup service has been requested due to AccuWeather timeout -.... +WARNING MetEireann fallback service has been requested due to AccuWeather timeout. +---- Response -.... +[source,text] +---- Beautiful day! -.... +---- -=== Run the tests +[discrete] +===== Running the test You can also try it out using the link:src/test/java/org/superbiz/rest/WeatherServiceTest.java[WeatherServiceTest.java] available in the project. -.... +[source,text] +---- mvn clean test -.... +---- -.... +---- [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -.... +----