Skip to content

Commit b642d62

Browse files
authored
Merge pull request #301 from OpenLiberty/staging
Merge staging to prod - Use versionless feature and MP7
2 parents db9be56 + befa398 commit b642d62

File tree

12 files changed

+68
-62
lines changed

12 files changed

+68
-62
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
canSkip: ${{ steps.Checker.outputs.canSkip }}
1313
steps:
1414
- name: Get files
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
- name: Get tools
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
with:
1919
path: tools/
2020
repository: openliberty/guides-common
@@ -45,10 +45,11 @@ jobs:
4545
working-directory: finish
4646

4747
steps:
48-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v4
4949
- name: Set up JDK 11
50-
uses: actions/setup-java@v1
50+
uses: actions/setup-java@v4
5151
with:
52+
distribution: 'semeru'
5253
java-version: 11
5354
- run: unset _JAVA_OPTIONS
5455

README.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018, 2023 IBM Corporation and others.
1+
// Copyright (c) 2018, 2025 IBM Corporation and others.
22
// Licensed under Creative Commons Attribution-NoDerivatives
33
// 4.0 International (CC BY-ND 4.0)
44
// https://creativecommons.org/licenses/by-nd/4.0/
@@ -12,7 +12,7 @@
1212
:page-guide-category: microprofile
1313
:page-essential: false
1414
: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']
1616
:page-permalink: /guides/{projectid}
1717
:page-related-guides: ['rest-intro', 'cdi-intro', 'microprofile-config', 'circuit-breaker']
1818
: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*
298298

299299
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.
300300
```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_
302302
```
303303

304304
See the following sample outputs for the **@Fallback** annotated method and the fallback method before a fallback occurs:
305305
endif::[]
306306

307307
[role="no_copy"]
308308
----
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
314314
----
315315

316316
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::[]
393393
ifdef::cloud-hosted[]
394394
Run the following curl command again and enter ***adminpwd*** as the password:
395395
```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_
397397
```
398398

399399
See the following sample outputs for the ***@Fallback*** annotated method and the fallback method after a fallback occurs:
400400
endif::[]
401401

402402
[role="no_copy"]
403403
----
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
409409
----
410410

411411
// Following context for the static guide:

finish/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>org.eclipse.microprofile</groupId>
3232
<artifactId>microprofile</artifactId>
33-
<version>6.1</version>
33+
<version>7.0</version>
3434
<type>pom</type>
3535
<scope>provided</scope>
3636
</dependency>

finish/src/main/liberty/config/server.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<server description="Sample Liberty server">
22

33
<featureManager>
4-
<feature>restfulWS-3.1</feature>
5-
<feature>jsonb-3.0</feature>
6-
<feature>jsonp-2.1</feature>
7-
<feature>cdi-4.0</feature>
8-
<feature>mpConfig-3.1</feature>
9-
<feature>mpRestClient-3.0</feature>
4+
<platform>jakartaee-10.0</platform>
5+
<platform>microprofile-7.0</platform>
6+
<feature>restfulWS</feature>
7+
<feature>jsonb</feature>
8+
<feature>jsonp</feature>
9+
<feature>cdi</feature>
10+
<feature>mpConfig</feature>
11+
<feature>mpRestClient</feature>
1012
<!-- tag::mpFaultTolerance[] -->
11-
<feature>mpFaultTolerance-4.0</feature>
13+
<feature>mpFaultTolerance</feature>
1214
<!-- end::mpFaultTolerance[] -->
1315
<!-- tag::mpMetrics[] -->
14-
<feature>mpMetrics-5.1</feature>
16+
<feature>mpMetrics</feature>
1517
<!-- end::mpMetrics[] -->
1618
</featureManager>
1719

finish/src/main/webapp/favicon.ico

14.7 KB
Binary file not shown.

finish/src/main/webapp/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ <h2>Eclipse MicroProfile</h2>
3434
<div id="technologies">
3535
<p>For more information about the features used in the application, see the Open Liberty documentation:</p>
3636
<ul>
37-
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile-6.1.html">MicroProfile 6.1</a></li>
38-
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS-3.1.html">Jakarta RESTful Web Services 3.1</a></li>
39-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp-2.1.html">Jakarta JSON Processing 2.1</a></li>
40-
<li><a href="https://openliberty.io/docs/ref/feature/#cdi-4.0.html">Jakarta Contexts and Dependency Injection 4.0</a></li>
41-
<li><a href="https://openliberty.io/docs/ref/feature/#mpConfig-3.1.html">MicroProfile Config 3.1</a></li>
42-
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient-3.0.html">MicroProfile Rest Client 3.0</a></li>
43-
<li><a href="https://openliberty.io/docs/ref/feature/#mpFaultTolerance-4.0.html">MicroProfile Fault Tolerance 4.0</a></li>
44-
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics-5.1.html">MicroProfile Metrics 5.1</a></li>
45-
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb-3.0.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding 3.0</a></li>
37+
<li><a href="https://openliberty.io/docs/ref/feature/#microProfile.html">MicroProfile</a></li>
38+
<li><a href="https://openliberty.io/docs/ref/feature/#restfulWS.html">Jakarta RESTful Web Services</a></li>
39+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonp.html">Jakarta JSON Processing</a></li>
40+
<li><a href="https://openliberty.io/docs/ref/feature/#cdi.html">Jakarta Contexts and Dependency Injection</a></li>
41+
<li><a href="https://openliberty.io/docs/ref/feature/#mpConfig.html">MicroProfile Config</a></li>
42+
<li><a href="https://openliberty.io/docs/ref/feature/#mpRestClient.html">MicroProfile Rest Client</a></li>
43+
<li><a href="https://openliberty.io/docs/ref/feature/#mpFaultTolerance.html">MicroProfile Fault Tolerance</a></li>
44+
<li><a href="https://openliberty.io/docs/ref/feature/#mpMetrics.html">MicroProfile Metrics 5.1</a></li>
45+
<li><a href="https://openliberty.io/docs/ref/feature/#jsonb.html" target="_blank" rel="noopener noreferrer">Jakarta JSON Binding</a></li>
4646
</ul>
4747
</div>
4848
</body>

finish/src/test/java/it/io/openliberty/guides/faulttolerance/FaultToleranceIT.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2018, 2022 IBM Corporation and others.
3+
* Copyright (c) 2018, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -26,8 +26,8 @@
2626

2727
public class FaultToleranceIT {
2828

29-
private Response response;
3029
private Client client;
30+
private Response response;
3131

3232
// tag::Before[]
3333
@BeforeEach
@@ -40,8 +40,8 @@ public void setup() {
4040
@AfterEach
4141
// end::After[]
4242
public void teardown() {
43-
client.close();
4443
response.close();
44+
client.close();
4545
}
4646
// tag::javadoc[]
4747
/**
@@ -78,8 +78,8 @@ public void testFallbackForGet() throws InterruptedException {
7878
int propertiesSizeFallBack = obj.size();
7979
assertTrue(propertiesSize > propertiesSizeFallBack,
8080
"The total number of properties from the @Fallback method "
81-
+ "is not smaller than the number from the system service"
82-
+ "as expected.");
81+
+ "is not smaller than the number from the system service"
82+
+ "as expected.");
8383
// tag::changeSystemProperty2[]
8484
TestUtils.changeSystemProperty(TestUtils.SYSTEM_MAINTENANCE_TRUE,
8585
TestUtils.SYSTEM_MAINTENANCE_FALSE);
@@ -103,7 +103,7 @@ public void testFallbackForGet() throws InterruptedException {
103103
// tag::testFallbackSkipForGet[]
104104
public void testFallbackSkipForGet() {
105105
response = TestUtils.getResponse(client,
106-
TestUtils.INVENTORY_UNKNOWN_HOST_URL);
106+
TestUtils.INVENTORY_UNKNOWN_HOST_URL);
107107
assertResponse(TestUtils.baseUrl, response, 404);
108108
assertTrue(response.readEntity(String.class).contains("error"),
109109
"Incorrect response body from "
@@ -118,7 +118,7 @@ public void testFallbackSkipForGet() {
118118
// end::javadoc[]
119119
private void assertResponse(String url, Response response, int statusCode) {
120120
assertEquals(statusCode, response.getStatus(),
121-
"Incorrect response code from " + url);
121+
"Incorrect response code from " + url);
122122
}
123123

124124
// tag::javadoc[]

finish/src/test/java/it/io/openliberty/guides/system/SystemEndpointIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2017, 2022 IBM Corporation and others.
3+
* Copyright (c) 2017, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -39,5 +39,6 @@ public void testGetProperties() {
3939
"The system property for the local and remote JVM should match");
4040

4141
response.close();
42+
client.close();
4243
}
4344
}

start/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- tag::microprofile[] -->
3232
<artifactId>microprofile</artifactId>
3333
<!-- end::microprofile[] -->
34-
<version>6.1</version>
34+
<version>7.0</version>
3535
<type>pom</type>
3636
<scope>provided</scope>
3737
</dependency>

start/src/main/liberty/config/server.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<server description="Sample Liberty server">
22

33
<featureManager>
4-
<feature>restfulWS-3.1</feature>
5-
<feature>jsonb-3.0</feature>
6-
<feature>jsonp-2.1</feature>
7-
<feature>cdi-4.0</feature>
8-
<feature>mpConfig-3.1</feature>
9-
<feature>mpRestClient-3.0</feature>
4+
<platform>jakartaee-10.0</platform>
5+
<platform>microprofile-7.0</platform>
6+
<feature>restfulWS</feature>
7+
<feature>jsonb</feature>
8+
<feature>jsonp</feature>
9+
<feature>cdi</feature>
10+
<feature>mpConfig</feature>
11+
<feature>mpRestClient</feature>
1012
<!-- tag::mpFaultTolerance[] -->
11-
<feature>mpFaultTolerance-4.0</feature>
13+
<feature>mpFaultTolerance</feature>
1214
<!-- end::mpFaultTolerance[] -->
1315
<!-- tag::mpMetrics[] -->
14-
<feature>mpMetrics-5.1</feature>
16+
<feature>mpMetrics</feature>
1517
<!-- end::mpMetrics[] -->
1618
</featureManager>
1719

0 commit comments

Comments
 (0)