Skip to content

Commit

Permalink
feat: project upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
epomatti committed Jan 18, 2025
1 parent 30bee63 commit 566d029
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 24 deletions.
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# Open Liberty - JMS & IBM MQ

[![Maven](https://img.shields.io/github/actions/workflow/status/epomatti/openliberty-jms-mq-example/maven.yml)](https://github.com/epomatti/openliberty-jms-mq-example/actions/workflows/maven.yml)


A sample application that uses Open Liberty to connect to IBM MQ to enqueue & dequeue messages.

> Updated to use Jakarta 9.1 and IBM MQ 9.3
## Setup

For this project you'll need to install the following requirements:

- JDK 17 (or later) - E.g. [Temurim](https://adoptium.net/installation/linux)
- Latest Maven, it must be Java 17 compatible - https://maven.apache.org/install.html
- JDK 21
- Maven
- Docker

## Running it

Pull and start the IBM MQ docker container:

> [!TIP]
> Since 9.2.5.0 new MQ images will be published to IBM's registry
```sh
docker pull icr.io/ibm-messaging/mq:latest

Expand All @@ -29,7 +27,6 @@ docker run --env LICENSE=accept \
--env MQ_APP_PASSWORD=passw0rd \
--name QM1 icr.io/ibm-messaging/mq:latest
```
> _Since 9.2.5.0 new MQ images will be published to IBM's registry._

Install the dependencies and start OpenLiberty:

Expand All @@ -48,13 +45,13 @@ curl -X POST -d 'msg=test message' http://localhost:9080/libertymq/api/enqueue

Implementation / tests performed with the latest/LTS versions of all components:

- openjdk 17.0.3 2022-04-19
- Jakarta EE 9.1
- Apache Maven 3.8.6
- OpenLibery 22.0.0.7
- IBM MQ & Resource Adapter 9.3.0.0
- Temurin-21.0.4+7
- Jakarta EE 10.0.0
- Apache Maven 3.9.9
- OpenLiberty 24.0.0.12
- IBM MQ & Resource Adapter 9.4.1.1

ℹ️ For convenience I'm versioning the adapter here. But you should get your specific version from [Fix Central](https://www.ibm.com/support/fixcentral/), following guidelines such as in [this procedure](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=adapter-installing-resource-in-liberty) for your particular version.
ℹ️ For convenience I'm versioning the adapter here. But you should get your specific version from [Fix Central](https://www.ibm.com/support/fixcentral/), following guidelines such as in [this procedure](https://www.ibm.com/docs/en/ibm-mq/9.4?topic=adapter-installing-resource-in-liberty) for your particular version.

## Sources

Expand Down
21 changes: 21 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2",
"ignorePaths": [],
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"allclient",
"ibmmq",
"jakartaee",
"jmsra",
"jndi",
"libertymq",
"openliberty",
"SVRCONN",
"Temurim",
"Temurin",
"wmqjmsra"
],
"ignoreWords": [],
"import": []
}
Binary file modified ibm/wmq.jakarta.jmsra.rar
Binary file not shown.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<packaging>war</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -18,7 +18,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.2</version>
<version>5.11.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -29,15 +29,15 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>

<!-- For localhost simple testing, not required -->
<dependency>
<groupId>com.ibm.mq</groupId>
<artifactId>com.ibm.mq.allclient</artifactId>
<version>9.3.0.0</version>
<version>9.4.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -54,18 +54,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<version>3.4.0</version>
</plugin>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.6.1</version>
<version>3.11.2</version>
</plugin>
<!-- JUnit 5 requires Surefire version 2.22.0 or higher -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.5.2</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/libertymq/rest/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Api {

@Inject
SampleProducer producer;

@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
Expand Down
3 changes: 2 additions & 1 deletion src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<server description="new server">

<featureManager>
<feature>jakartaee-9.1</feature>
<feature>jakartaee-10.0</feature>
</featureManager>

<!-- START JMS CONFIGURATION -->
Expand Down Expand Up @@ -59,5 +59,6 @@

<webApplication contextRoot="/libertymq" location="libertymq.war" />

<!-- https://openliberty.io/docs/latest/reference/config/ssl.html -->
<ssl id="defaultSSLConfig" trustDefaultCerts="true" />
</server>

0 comments on commit 566d029

Please sign in to comment.