Skip to content

Commit 23f35c4

Browse files
Ruilin-MaRuilin Magkwan-ibmshin19991207
authored
Update to MP61 and JEE10 (#96)
* mp6-ee10-update * lint correction * lint correction * lint correction * lint correction * Integration test updated for system and inventory service * container test issue fixed * lint correction * lint correction * tag remove + duplication warning fix * lint correction * reset system added * update default.http.port to http.port * Merged staging * Dependencies and year labels updated * dependencies version updated & index.html update * devc update * added import for Socket * change mod of start/stopKafka.bat * add 1 sec for propertyConsumer poll the record * lint correction * update versions * update containerRunOpts * polish the code * polish the code * start kafka container first * update resteasy * remove references to zookeeper * Update README.adoc --------- Co-authored-by: Ruilin Ma <Ruilin.Ma@ibm.com> Co-authored-by: Gilbert Kwan <gkwan@ca.ibm.com> Co-authored-by: Morgan Chang <shin19991207@gmail.com>
1 parent a3a16b0 commit 23f35c4

File tree

67 files changed

+1554
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1554
-831
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: maven
4+
directory: "/finish"
5+
schedule:
6+
interval: monthly
7+
open-pull-requests-limit: 50
8+
- package-ecosystem: maven
9+
directory: "/start"
10+
schedule:
11+
interval: monthly
12+
open-pull-requests-limit: 50

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
working-directory: finish
4646
steps:
4747
- uses: actions/checkout@v2
48-
- name: Set up JDK 8
48+
- name: Set up JDK 11
4949
uses: actions/setup-java@v1
5050
with:
51-
java-version: 8
51+
java-version: 11
5252
- run: unset _JAVA_OPTIONS
5353
- name: Run tests
5454
run: sudo ../scripts/testApp.sh

README.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2023 IBM Corporation and others.
1+
// Copyright (c) 2020, 2024 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/
@@ -10,11 +10,12 @@
1010
:page-layout: guide-multipane
1111
:page-duration: 25 minutes
1212
:page-releasedate: 2020-07-28
13+
:page-majorupdateddate: 2024-04-04
1314
:page-guide-category: microprofile
1415
:page-essential: false
1516
:page-description: Learn how to integrate RESTful services with a reactive system using MicroProfile Reactive Messaging.
1617
:guide-author: Open Liberty
17-
:page-tags: ['MicroProfile', 'Jakarta EE']
18+
:page-tags: ['microprofile', 'jakarta-ee']
1819
:page-related-guides: ['reactive-service-testing', 'microprofile-reactive-messaging']
1920
:page-permalink: /guides/{projectid}
2021
:imagesdir: /img/guide/{projectid}
@@ -166,7 +167,7 @@ docker build -t system:1.0-SNAPSHOT system/.
166167
docker build -t inventory:1.0-SNAPSHOT inventory/.
167168
```
168169

169-
Next, use the provided script to start the application in Docker containers. The script creates a network for the containers to communicate with each other. It also creates containers for Kafka, Zookeeper, and the microservices in the project. For simplicity, the script starts one instance of the `system` service.
170+
Next, use the provided script to start the application in Docker containers. The script creates a network for the containers to communicate with each other. It also creates containers for Kafka and the microservices in the project. For simplicity, the script starts one instance of the `system` service.
170171

171172
include::{common-includes}/os-tabs.adoc[]
172173

finish/inventory/pom.xml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@
88
<packaging>war</packaging>
99

1010
<properties>
11-
<maven.compiler.source>1.8</maven.compiler.source>
12-
<maven.compiler.target>1.8</maven.compiler.target>
11+
<maven.compiler.source>11</maven.compiler.source>
12+
<maven.compiler.target>11</maven.compiler.target>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1515
<!-- Liberty configuration -->
16-
<liberty.var.default.http.port>9085</liberty.var.default.http.port>
17-
<liberty.var.default.https.port>9448</liberty.var.default.https.port>
16+
<liberty.var.http.port>9085</liberty.var.http.port>
17+
<liberty.var.https.port>9448</liberty.var.https.port>
1818
</properties>
1919

2020
<dependencies>
2121
<!-- Provided dependencies -->
2222
<dependency>
2323
<groupId>jakarta.platform</groupId>
2424
<artifactId>jakarta.jakartaee-api</artifactId>
25-
<version>8.0.0</version>
25+
<version>10.0.0</version>
2626
<scope>provided</scope>
2727
</dependency>
2828
<dependency>
29-
<groupId>javax.enterprise.concurrent</groupId>
30-
<artifactId>javax.enterprise.concurrent-api</artifactId>
31-
<version>1.1</version>
29+
<groupId>jakarta.enterprise.concurrent</groupId>
30+
<artifactId>jakarta.enterprise.concurrent-api</artifactId>
31+
<version>3.0.3</version>
3232
<scope>provided</scope>
3333
</dependency>
3434
<dependency>
3535
<groupId>org.eclipse.microprofile</groupId>
3636
<artifactId>microprofile</artifactId>
37-
<version>3.3</version>
37+
<version>6.1</version>
3838
<type>pom</type>
3939
<scope>provided</scope>
4040
</dependency>
4141
<!-- tag::reactiveMessaging[] -->
4242
<dependency>
4343
<groupId>org.eclipse.microprofile.reactive.messaging</groupId>
4444
<artifactId>microprofile-reactive-messaging-api</artifactId>
45-
<version>1.0</version>
45+
<version>3.0</version>
4646
<scope>provided</scope>
4747
</dependency>
4848
<!-- end::reactiveMessaging[] -->
@@ -57,33 +57,55 @@
5757
<dependency>
5858
<groupId>org.apache.kafka</groupId>
5959
<artifactId>kafka-clients</artifactId>
60-
<version>2.8.1</version>
60+
<version>3.7.0</version>
6161
</dependency>
6262
<!-- end::kafka[] -->
6363
<!-- tag::rxjava[] -->
6464
<dependency>
6565
<groupId>io.reactivex.rxjava3</groupId>
6666
<artifactId>rxjava</artifactId>
67-
<version>3.1.2</version>
67+
<version>3.1.8</version>
6868
</dependency>
6969
<!-- end::rxjava[] -->
70-
<!-- For tests -->
7170
<dependency>
72-
<groupId>org.microshed</groupId>
73-
<artifactId>microshed-testing-liberty</artifactId>
74-
<version>0.9.1</version>
75-
<scope>test</scope>
71+
<groupId>org.slf4j</groupId>
72+
<artifactId>slf4j-api</artifactId>
73+
<version>2.0.12</version>
7674
</dependency>
75+
<dependency>
76+
<groupId>org.slf4j</groupId>
77+
<artifactId>slf4j-simple</artifactId>
78+
<version>2.0.12</version>
79+
</dependency>
80+
<!-- For tests -->
7781
<dependency>
7882
<groupId>org.testcontainers</groupId>
7983
<artifactId>kafka</artifactId>
80-
<version>1.16.2</version>
84+
<version>1.19.7</version>
8185
<scope>test</scope>
8286
</dependency>
8387
<dependency>
8488
<groupId>org.junit.jupiter</groupId>
8589
<artifactId>junit-jupiter</artifactId>
86-
<version>5.8.1</version>
90+
<version>5.10.2</version>
91+
<scope>test</scope>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.testcontainers</groupId>
95+
<artifactId>junit-jupiter</artifactId>
96+
<version>1.19.7</version>
97+
<scope>test</scope>
98+
</dependency>
99+
<dependency>
100+
<groupId>org.jboss.resteasy</groupId>
101+
<artifactId>resteasy-client</artifactId>
102+
<version>6.2.8.Final</version>
103+
<scope>test</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.jboss.resteasy</groupId>
107+
<artifactId>resteasy-json-binding-provider</artifactId>
108+
<version>6.2.8.Final</version>
87109
<scope>test</scope>
88110
</dependency>
89111
</dependencies>
@@ -94,7 +116,7 @@
94116
<plugin>
95117
<groupId>org.apache.maven.plugins</groupId>
96118
<artifactId>maven-war-plugin</artifactId>
97-
<version>3.3.2</version>
119+
<version>3.4.0</version>
98120
<configuration>
99121
<packagingExcludes>pom.xml</packagingExcludes>
100122
</configuration>
@@ -104,21 +126,29 @@
104126
<plugin>
105127
<groupId>io.openliberty.tools</groupId>
106128
<artifactId>liberty-maven-plugin</artifactId>
107-
<version>3.8.2</version>
129+
<version>3.10.2</version>
130+
<configuration>
131+
<!-- devc config -->
132+
<containerRunOpts>
133+
-e WLP_LOGGING_CONSOLE_LOGLEVEL=info
134+
-p 9085:9085
135+
--network=reactive-app
136+
</containerRunOpts>
137+
</configuration>
108138
</plugin>
109139

110140
<!-- Plugin to run unit tests -->
111141
<plugin>
112142
<groupId>org.apache.maven.plugins</groupId>
113143
<artifactId>maven-surefire-plugin</artifactId>
114-
<version>2.22.2</version>
144+
<version>3.2.5</version>
115145
</plugin>
116146

117147
<!-- Plugin to run integration tests -->
118148
<plugin>
119149
<groupId>org.apache.maven.plugins</groupId>
120150
<artifactId>maven-failsafe-plugin</artifactId>
121-
<version>2.22.2</version>
151+
<version>3.2.5</version>
122152
<executions>
123153
<execution>
124154
<goals>
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020 IBM Corporation and others.
3+
* Copyright (c) 2020, 2024 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
package io.openliberty.guides.inventory;
1413

15-
import javax.ws.rs.core.Application;
16-
import javax.ws.rs.ApplicationPath;
14+
import jakarta.ws.rs.core.Application;
15+
import jakarta.ws.rs.ApplicationPath;
1716

1817
@ApplicationPath("/")
1918
public class InventoryApplication extends Application {
2019

21-
}
20+
}

finish/inventory/src/main/java/io/openliberty/guides/inventory/InventoryManager.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020 IBM Corporation and others.
3+
* Copyright (c) 2020, 2024 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License v1.0
5+
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
7-
* http://www.eclipse.org/legal/epl-v10.html
7+
* http://www.eclipse.org/legal/epl-2.0/
88
*
9-
* Contributors:
10-
* IBM Corporation - Initial implementation
9+
* SPDX-License-Identifier: EPL-2.0
1110
*******************************************************************************/
1211
// end::copyright[]
1312
package io.openliberty.guides.inventory;
@@ -18,12 +17,13 @@
1817
import java.util.Properties;
1918
import java.util.TreeMap;
2019

21-
import javax.enterprise.context.ApplicationScoped;
20+
import jakarta.enterprise.context.ApplicationScoped;
2221

2322
@ApplicationScoped
2423
public class InventoryManager {
2524

26-
private Map<String, Properties> systems = Collections.synchronizedMap(new TreeMap<String, Properties>());
25+
private Map<String, Properties> systems = Collections.synchronizedMap(
26+
new TreeMap<String, Properties>());
2727

2828
public void addSystem(String hostname, Double systemLoad) {
2929
if (!systems.containsKey(hostname)) {
@@ -46,8 +46,9 @@ public void addSystem(String hostname, String key, String value) {
4646
public void updateCpuStatus(String hostname, Double systemLoad) {
4747
Optional<Properties> p = getSystem(hostname);
4848
if (p.isPresent()) {
49-
if (p.get().getProperty(hostname) == null && hostname != null)
49+
if (p.get().getProperty(hostname) == null && hostname != null) {
5050
p.get().put("systemLoad", systemLoad);
51+
}
5152
}
5253
}
5354

@@ -72,4 +73,4 @@ public Map<String, Properties> getSystems() {
7273
public void resetSystems() {
7374
systems.clear();
7475
}
75-
}
76+
}

0 commit comments

Comments
 (0)