|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + |
| 4 | +<head> |
| 5 | + <title>Fault Tolerance 6.8.0</title> |
| 6 | + <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script> |
| 7 | + <script src="/assets/javascript/highlightjs-pack.js" type="text/javascript"></script> |
| 8 | + <meta http-equiv="Content-Security-Policy" content=" |
| 9 | + connect-src 'self' https://dpm.demdex.net https://adobedc.demdex.net https://smetrics.redhat.com; |
| 10 | + script-src 'self' 'unsafe-inline' 'unsafe-eval' |
| 11 | + |
| 12 | + https://assets.adobedtm.com |
| 13 | + https://www.redhat.com |
| 14 | + https://static.redhat.com |
| 15 | + jsonip.com |
| 16 | + https://ajax.googleapis.com |
| 17 | + https://use.fontawesome.com |
| 18 | + http://www.youtube.com |
| 19 | + http://www.googleadservices.com |
| 20 | + https://googleads.g.doubleclick.net |
| 21 | + https://www.google-analytics.com; |
| 22 | +
|
| 23 | + style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; |
| 24 | + img-src 'self' * data:; |
| 25 | + media-src 'self'; |
| 26 | + frame-src https://redhat.demdex.net; |
| 27 | + base-uri 'none'; |
| 28 | + object-src 'none'; |
| 29 | + form-action 'none'; |
| 30 | + font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;" /> |
| 31 | + <META HTTP-EQUIV="X-Frame-Options" CONTENT="DENY"> |
| 32 | + <META HTTP-EQUIV="X-XSS-Protection" CONTENT="1; mode=block"> |
| 33 | + <META HTTP-EQUIV="X-Content-Type-Options" CONTENT="nosniff"> |
| 34 | + <meta charset="utf-8"> |
| 35 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 36 | + <meta name="description" content="SmallRye is a project to share and collaborate on implementing specifications that are part of Eclipse MicroProfile."> |
| 37 | + <link rel="shortcut icon" type="image/png" href="/favicon.ico" > |
| 38 | + <link rel="stylesheet" href="/assets/css/main.css" /> |
| 39 | + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous"> |
| 40 | +</head> |
| 41 | + |
| 42 | +<body class="post"> |
| 43 | + |
| 44 | + <div class="content"> |
| 45 | + <div class="navigation-wrapper"> |
| 46 | + <div class="width-12-12"> |
| 47 | + <div class="header navigation"> |
| 48 | + <div class="logo-wrapper"> |
| 49 | + <a href="/"><img class="project-logo" title="SmallRye" src="/assets/images/smallrye_project_logo.svg"></a> |
| 50 | + </div> |
| 51 | + <div class="nav-container"> |
| 52 | + <nav> |
| 53 | + <div class="nav-mobile"><a id="nav-toggle" href="#!"><span></span></a></div> |
| 54 | + <ul class="nav-list"> |
| 55 | + <li> |
| 56 | + <a href="/projects/" class="">Projects</a> |
| 57 | + </li> |
| 58 | + <li> |
| 59 | + <a href="/community/" class="">Community</a> |
| 60 | + </li> |
| 61 | + <li> |
| 62 | + <a href="/blog/" class="active">Blog</a> |
| 63 | + </li> |
| 64 | + <li> |
| 65 | + <a href="/docs/index.html" class="">Documentation</a> |
| 66 | + </li> |
| 67 | + </ul> |
| 68 | + </nav> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + </div> |
| 72 | +</div> |
| 73 | + |
| 74 | + <div class="post-page grid-wrapper"> |
| 75 | + <div class="grid__item width-10-12 doc-content"> |
| 76 | + <h1>Fault Tolerance 6.8.0</h1> |
| 77 | + <div class="paragraph"> |
| 78 | +<p>Today, we announce the <a href="https://github.com/smallrye/smallrye-fault-tolerance/releases/tag/6.8.0">release</a> of SmallRye Fault Tolerance 6.8.0. |
| 79 | +This release contains one new feature.</p> |
| 80 | +</div> |
| 81 | +<div class="paragraph"> |
| 82 | +<p>In <a href="/blog/fault-tolerance-6-7-0">SmallRye Fault Tolerance 6.7.0</a>, we introduced a new programmatic API, together with an annotation to use the programmatically created <code>Guard</code> / <code>TypedGuard</code> objects declaratively: <code>@ApplyGuard</code>. |
| 83 | +In this release, we add support for configuration for <code>@ApplyGuard</code> using MicroProfile Config. |
| 84 | +Note that <code>Guard</code> and <code>TypedGuard</code> themselves still do not support configuration, only <code>@ApplyGuard</code> does.</p> |
| 85 | +</div> |
| 86 | +<div class="paragraph"> |
| 87 | +<p>This means that if you want to configure the <code>Guard</code>/<code>TypedGuard</code> used declaratively via <code>@ApplyGuard</code>, you should <strong>NEVER</strong> use those objects programmatically. |
| 88 | +Configuration is applied on creation, which happens lazily, on the first use. |
| 89 | +This first use must be through <code>@ApplyGuard</code>, otherwise configuration would be ignored.</p> |
| 90 | +</div> |
| 91 | +<div class="paragraph"> |
| 92 | +<p>Configuration keys are still the same, except you use the <code>@Identifier</code> value instead of a <code><classname></code> or <code><classname>/<methodname></code>.</p> |
| 93 | +</div> |
| 94 | +<div class="paragraph"> |
| 95 | +<p>For example, let’s assume the following <code>Guard</code> declaration:</p> |
| 96 | +</div> |
| 97 | +<div class="listingblock"> |
| 98 | +<div class="content"> |
| 99 | +<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">@ApplicationScoped |
| 100 | +public class PreconfiguredFaultTolerance { |
| 101 | + @Produces |
| 102 | + @Identifier("my-fault-tolerance") |
| 103 | + public static final Guard GUARD = Guard.create() |
| 104 | + .withRetry().maxRetries(2).done() |
| 105 | + .build(); |
| 106 | +}</code></pre> |
| 107 | +</div> |
| 108 | +</div> |
| 109 | +<div class="paragraph"> |
| 110 | +<p>Then, to configure the maximum number of retries, one can use the following configuration keys:</p> |
| 111 | +</div> |
| 112 | +<div class="ulist"> |
| 113 | +<ul> |
| 114 | +<li> |
| 115 | +<p>SmallRye Fault Tolerance specific: <code>smallrye.faulttolerance."my-fault-tolerance".retry.max-retries</code></p> |
| 116 | +</li> |
| 117 | +<li> |
| 118 | +<p>specification defined: <code>my-fault-tolerance/Retry/maxRetries</code></p> |
| 119 | +</li> |
| 120 | +</ul> |
| 121 | +</div> |
| 122 | +<div class="paragraph"> |
| 123 | +<p>Global configuration also applies to <code>@ApplyGuard</code>. In this case, the keys are:</p> |
| 124 | +</div> |
| 125 | +<div class="ulist"> |
| 126 | +<ul> |
| 127 | +<li> |
| 128 | +<p>SmallRye Fault Tolerance specific: <code>smallrye.faulttolerance.global.retry.max-retries</code></p> |
| 129 | +</li> |
| 130 | +<li> |
| 131 | +<p>specification defined: <code>Retry/maxRetries</code></p> |
| 132 | +</li> |
| 133 | +</ul> |
| 134 | +</div> |
| 135 | +<div class="paragraph"> |
| 136 | +<p>Enablement configuration also applies. Note however that if the <code>Guard</code> or <code>TypedGuard</code> is created <em>without</em> certain fault tolerance strategy, no amount of configuration can add it. |
| 137 | +Configuration only applies to strategies that were added in the builder.</p> |
| 138 | +</div> |
| 139 | +<div class="paragraph"> |
| 140 | +<p>As usual, if you have any ideas for improvements, please <a href="https://github.com/smallrye/smallrye-fault-tolerance/issues">file an issue</a>!</p> |
| 141 | +</div> |
| 142 | + </div> |
| 143 | +</div> |
| 144 | + |
| 145 | + </div> |
| 146 | + |
| 147 | + <div class="content project-footer"> |
| 148 | + <div class="footer-section"> |
| 149 | + <div class="logo-wrapper"> |
| 150 | + <a href="/"><img src="/assets/images/smallrye_project_logo.svg" class="project-logo" title="SmallRye"></a> |
| 151 | + </div> |
| 152 | + </div> |
| 153 | + <div class="grid-wrapper"> |
| 154 | + <p class="grid__item width-3-12">SmallRye is open source under <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a>. <br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a> is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/smallrye/smallrye.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p> |
| 155 | + |
| 156 | + |
| 157 | + <div class="width-1-12 project-links"> |
| 158 | + <span>Navigation</span> |
| 159 | + <ul class="footer-links width-1-12"> |
| 160 | + |
| 161 | + <li><a href="/">Home</a></li> |
| 162 | + |
| 163 | + </ul> |
| 164 | + </div> |
| 165 | + |
| 166 | + <div class="width-1-12 project-links"> |
| 167 | + <span>Contribute</span> |
| 168 | + <ul class="footer-links width-1-12"> |
| 169 | + |
| 170 | + <li><a href="https://twitter.com/smallrye_io">Follow us</a></li> |
| 171 | + |
| 172 | + <li><a href="https://github.com/smallrye">GitHub</a></li> |
| 173 | + |
| 174 | + </ul> |
| 175 | + </div> |
| 176 | + |
| 177 | + <div class="width-1-12 project-links"> |
| 178 | + <span>Get Help</span> |
| 179 | + <ul class="footer-links width-1-12"> |
| 180 | + |
| 181 | + <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li> |
| 182 | + |
| 183 | + <li><a href="https://groups.google.com/d/forum/smallrye">Google Groups</a></li> |
| 184 | + |
| 185 | + </ul> |
| 186 | + </div> |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + <div class="width-6-12 more-links"> |
| 191 | + <span>External Links</span> |
| 192 | + <ul class="footer-links"> |
| 193 | + |
| 194 | + <li><a href="https://microprofile.io/" target="_blank">Eclipse MicroProfile</a></li> |
| 195 | + |
| 196 | + <li><a href="https://github.com/eclipse?utf8=✓&q=microprofile" target="_blank">Eclipse MicroProfile on GitHub</a></li> |
| 197 | + |
| 198 | + </ul> |
| 199 | + </div> |
| 200 | + |
| 201 | + </div> |
| 202 | +</div> |
| 203 | + <div class="content redhat-footer"> |
| 204 | + <div class="grid-wrapper"> |
| 205 | + <span class="licence"> |
| 206 | + <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> |
| 207 | + | <a href="https://www.redhat.com/en/about/privacy-policy">Red Hat Privacy Policy</a> |
| 208 | + </span> |
| 209 | + <span class="redhat"> |
| 210 | + a Red Hat sponsored project |
| 211 | + </span> |
| 212 | + <span class="redhat-logo"> |
| 213 | + <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a> |
| 214 | + </span> |
| 215 | + </div> |
| 216 | +</div> |
| 217 | + |
| 218 | + |
| 219 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |
| 220 | + <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script> |
| 221 | + <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script> |
| 222 | + <script type="text/javascript" src="/assets/javascript/satellite.js"></script> |
| 223 | +</body> |
| 224 | + |
| 225 | +</html> |
0 commit comments