Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use versionless features #78

Merged
merged 14 commits into from
Feb 3, 2025
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
canSkip: ${{ steps.Checker.outputs.canSkip }}
steps:
- name: Get files
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get tools
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: tools/
repository: openliberty/guides-common
Expand Down Expand Up @@ -44,10 +44,11 @@ jobs:
run:
working-directory: finish
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'semeru'
java-version: 17
- run: unset _JAVA_OPTIONS
- name: Run tests
Expand All @@ -61,6 +62,8 @@ jobs:
sudo cat "$logsPath" | sudo grep Launching
logsPath=$(sudo find . -name "console.log" | grep system);
sudo cat "$logsPath" | sudo grep Launching
sudo chmod -R a+xr system/target
sudo chmod -R a+xr inventory/target
- name: Archive finish inventory logs if failed
if: failure()
uses: actions/upload-artifact@v4
Expand Down
6 changes: 2 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 IBM Corporation and others.
// Copyright (c) 2024, 2025 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand Down Expand Up @@ -193,7 +193,7 @@ include::finish/inventory/src/main/java/io/openliberty/guides/inventory/Inventor

The `inventory` microservice receives the messages from the `system` microservice. Implement the [hotspot=InventoryQueueListener file=0]`InventoryQueueListener` class with the `MessageListener` interface and annotate with [hotspot=messageDriven file=0]`@MessageDriven` to monitor the `jms/InventoryQueue` message queue. Implement the [hotspot=onMessage file=0]`onMessage()` method that processes the incoming messages, updates the inventory by using the [hotspot=InventoryManager hotspot=InventoryManagerUpdate file=0]`InventoryManager` bean, and logs the action. Use the [hotspot=systemLoad file=0]`SystemLoad.fromJson()` method to convert the JSON message string to the `SystemLoad` object.

Next, configure the `inventory` microservice with an embedded messaging server and the https://openliberty.io/docs/latest/reference/feature/messagingClient-3.0.html[Messaging Server Client^] feature.
Next, configure the `inventory` microservice with an embedded messaging server and the https://openliberty.io/docs/latest/reference/feature/messagingClient.html[Messaging Server Client^] feature.

[role='code_command hotspot file=1', subs="quotes"]
----
Expand Down Expand Up @@ -299,8 +299,6 @@ endif::[]

== Testing the inventory application

//similar to https://openliberty.io/guides/cdi-intro.html#testing-the-inventory-application
//explain the test
While you can test your application manually, you should rely on automated tests because they trigger a failure whenever a code change introduces a defect. Because the application is a RESTful web service application, you can use JUnit and the RESTful web service Client API to write tests. In testing the functionality of the application, the scopes and dependencies are being tested.

[role='code_command hotspot file=0', subs='quotes']
Expand Down
2 changes: 1 addition & 1 deletion finish/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
22 changes: 12 additions & 10 deletions finish/inventory/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<server description="Inventory Service">

<featureManager>
<feature>restfulWS-3.1</feature>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>restfulWS</feature>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<!-- tag::messaging[] -->
<feature>messaging-3.1</feature>
<feature>messaging</feature>
<!-- end::messaging[] -->
<!-- tag::messagingServer[] -->
<feature>messagingServer-3.0</feature>
<feature>messagingServer</feature>
<!-- end::messagingServer[] -->
<!-- tag::messagingClient[] -->
<feature>messagingClient-3.0</feature>
<feature>messagingClient</feature>
<!-- end::messagingClient[] -->
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9081"/>
Expand Down
2 changes: 1 addition & 1 deletion finish/models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion finish/system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
18 changes: 10 additions & 8 deletions finish/system/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<server description="System Service">

<featureManager>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<!-- tag::messaging[] -->
<feature>messaging-3.1</feature>
<feature>messaging</feature>
<!-- end::messaging[] -->
<!-- tag::messagingClient[] -->
<feature>messagingClient-3.0</feature>
<feature>messagingClient</feature>
<!-- end::messagingClient[] -->
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9082"/>
Expand Down
2 changes: 1 addition & 1 deletion ibmmq/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
22 changes: 12 additions & 10 deletions ibmmq/inventory/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<server description="Inventory Service">

<featureManager>
<feature>restfulWS-3.1</feature>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<feature>messaging-3.1</feature>
<feature>messagingClient-3.0</feature>
<feature>messagingServer-3.0</feature>
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>restfulWS</feature>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<feature>messaging</feature>
<feature>messagingClient</feature>
<feature>messagingServer</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9081"/>
Expand Down
2 changes: 1 addition & 1 deletion ibmmq/system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
18 changes: 10 additions & 8 deletions ibmmq/system/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<server description="System Service">

<featureManager>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<feature>messaging-3.1</feature>
<feature>messagingClient-3.0</feature>
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<feature>messaging</feature>
<feature>messagingClient</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9082"/>
Expand Down
2 changes: 1 addition & 1 deletion start/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
22 changes: 12 additions & 10 deletions start/inventory/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<server description="Inventory Service">

<featureManager>
<feature>restfulWS-3.1</feature>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<feature>messaging-3.1</feature>
<feature>messagingClient-3.0</feature>
<feature>messagingServer-3.0</feature>
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>restfulWS</feature>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<feature>messaging</feature>
<feature>messagingClient</feature>
<feature>messagingServer</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9081"/>
Expand Down
2 changes: 1 addition & 1 deletion start/models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion start/system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>6.1</version>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Expand Down
14 changes: 8 additions & 6 deletions start/system/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<server description="System Service">

<featureManager>
<feature>cdi-4.0</feature>
<feature>jsonb-3.0</feature>
<feature>mpHealth-4.0</feature>
<feature>mpConfig-3.1</feature>
<feature>enterpriseBeansLite-4.0</feature>
<feature>mdb-4.0</feature>
<platform>jakartaee-10.0</platform>
<platform>microprofile-7.0</platform>
<feature>cdi</feature>
<feature>jsonb</feature>
<feature>mpHealth</feature>
<feature>mpConfig</feature>
<feature>enterpriseBeansLite</feature>
<feature>mdb</feature>
</featureManager>

<variable name="http.port" defaultValue="9082"/>
Expand Down
Loading