|
1 | | -// Copyright (c) 2018, 2023 IBM Corporation and others. |
| 1 | +// Copyright (c) 2018, 2025 IBM Corporation and others. |
2 | 2 | // Licensed under Creative Commons Attribution-NoDerivatives |
3 | 3 | // 4.0 International (CC BY-ND 4.0) |
4 | 4 | // https://creativecommons.org/licenses/by-nd/4.0/ |
|
12 | 12 | :page-guide-category: microprofile |
13 | 13 | :page-essential: false |
14 | 14 | :page-description: Learn how to add fallback behavior to microservice dependencies to manage the impact of failures. |
15 | | -:page-tags: ['MicroProfile'] |
| 15 | +:page-tags: ['microprofile'] |
16 | 16 | :page-permalink: /guides/{projectid} |
17 | 17 | :page-related-guides: ['rest-intro', 'cdi-intro', 'microprofile-config', 'circuit-breaker'] |
18 | 18 | :page-seo-title: Building fault-tolerant Java microservices with Eclipse MicroProfile Fault Tolerance's fallback policy |
@@ -298,19 +298,19 @@ Notice that the results from the two URLs are identical because the **inventory* |
298 | 298 |
|
299 | 299 | To see the application metrics, run the following curl commmand. This command will Log in using **admin** user, and you will have to enter **adminpwd** as the password. |
300 | 300 | ```bash |
301 | | -curl -k -u admin https://localhost:9443/metrics?scope=base | grep _ft_ |
| 301 | +curl -k -u admin https://localhost:9443/metrics?scope=base | grep ft_ |
302 | 302 | ``` |
303 | 303 |
|
304 | 304 | See the following sample outputs for the **@Fallback** annotated method and the fallback method before a fallback occurs: |
305 | 305 | endif::[] |
306 | 306 |
|
307 | 307 | [role="no_copy"] |
308 | 308 | ---- |
309 | | -# TYPE base_ft_invocations_total counter |
310 | | -base_ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
311 | | -base_ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 0 |
312 | | -base_ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
313 | | -base_ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
| 309 | +# TYPE ft_invocations_total counter |
| 310 | +ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
| 311 | +ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 0 |
| 312 | +ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
| 313 | +ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
314 | 314 | ---- |
315 | 315 |
|
316 | 316 | You can test the fault tolerance mechanism of your microservices by dynamically changing the [hotspot=2 file=0]`io_openliberty_guides_system_inMaintenance` property value to `true` in the [hotspot file=0]`resources/CustomConfigSource.json` file, which puts the `system` service in maintenance. |
@@ -393,19 +393,19 @@ endif::[] |
393 | 393 | ifdef::cloud-hosted[] |
394 | 394 | Run the following curl command again and enter ***adminpwd*** as the password: |
395 | 395 | ```bash |
396 | | -curl -k -u admin https://localhost:9443/metrics?scope=base | grep _ft_ |
| 396 | +curl -k -u admin https://localhost:9443/metrics?scope=base | grep ft_ |
397 | 397 | ``` |
398 | 398 |
|
399 | 399 | See the following sample outputs for the ***@Fallback*** annotated method and the fallback method after a fallback occurs: |
400 | 400 | endif::[] |
401 | 401 |
|
402 | 402 | [role="no_copy"] |
403 | 403 | ---- |
404 | | -# TYPE base_ft_invocations_total counter |
405 | | -base_ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
406 | | -base_ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
407 | | -base_ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
408 | | -base_ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
| 404 | +# TYPE ft_invocations_total counter |
| 405 | +ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
| 406 | +ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="valueReturned"} 1 |
| 407 | +ft_invocations_total{fallback="notApplied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
| 408 | +ft_invocations_total{fallback="applied",method="io.openliberty.guides.inventory.InventoryManager.get",result="exceptionThrown"} 0 |
409 | 409 | ---- |
410 | 410 |
|
411 | 411 | // Following context for the static guide: |
|
0 commit comments