Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Chapter04/README.liberty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# README.liberty.md

## Build and excute
```
mvn -f pom.xml.liberty clean package liberty:run
```

## Endpoints

http://localhost:9080/
```
Entry page of runtime.
```

http://localhost:9080/ch4/rest/hello
```
Hello World!
```

http://localhost:9080/ch4/rest/client/mp/funny

```
result: silly,hilarious,jovial
```

http://localhost:9080/ch4/rest/sse
```
result:

event: fooEvent
id: 1
data: foo

event: barEvent
id: 2
data: bar

event: bazEvent
id: 3
data: baz
```

http://localhost:9080/ch4/rest/test/sse
```
result: foo bar baz
```

# END.
50 changes: 50 additions & 0 deletions Chapter04/README.payara.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# README.payara.md

**NOTE: Payara is not ready to execute this code.**
**NOTE: Tested LATEST (6.2021.1.Alpha1) and 5.2021.1 till 5.2021.8 and FAILED.**
**NOTE: In case we change the code on @RestClient injection and move the @Consumes / @Produces annotations directly to the GET, PUT, POST, DELETE and UPDATE method we get it working ...**
**PROBLEM: liberty, quarkus and wíldfly microprofile runtimes are working well with the current code base unchanged.**

Disregard below details as all of them do not work:

## Build and excute
```
mvn -f pom.xml.payara clean package
java -jar target/ch4-microbundle.jar --port 9080 --contextroot ch4
```

## Endpoints

http://localhost:9080/ch4/rest/hello
```
Hello World!
```

http://localhost:9080/ch4/rest/client/mp/funny
```
result: silly,hilarious,jovial
```

http://localhost:9080/ch4/rest/sse
```
result:

event: fooEvent
id: 1
data: foo

event: barEvent
id: 2
data: bar

event: bazEvent
id: 3
data: baz
```

http://localhost:9080/ch4/rest/test/sse
```
result: foo bar baz
```

# END.
47 changes: 47 additions & 0 deletions Chapter04/README.quarkus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# README.quarkus.md

## Build and excute
```
mvn -Dquarkus.http.port=9080 -Dquarkus.http.root-path=ch4 -f pom.xml.quarkus clean package quarkus:dev
```

## Endpoints

http://localhost:9080/ch4/rest
```
overview page of runtime.
```

http://localhost:9080/ch4/rest/hello
```
Hello World!
```

http://localhost:9080/ch4/rest/client/mp/funny
```
result: silly,hilarious,jovial
```

http://localhost:9080/ch4/rest/sse
```
result:

event: fooEvent
id: 1
data: foo

event: barEvent
id: 2
data: bar

event: bazEvent
id: 3
data: baz
```

http://localhost:9080/ch4/rest/test/sse
```
result: foo bar baz
```

# END.
43 changes: 43 additions & 0 deletions Chapter04/README.wildfly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# README.wildfly.md

## Build and excute
```
mvn -f pom.xml.wildfly clean package
java -jar -Djboss.http.port=9080 target/ch4-bootable.jar
```

## Endpoints

http://localhost:9080/ch4/rest/hello
```
Hello World!
```

http://localhost:9080/ch4/rest/client/mp/funny
```
result: silly,hilarious,jovial
```

http://localhost:9080/ch4/rest/sse
```
result:

event: fooEvent
id: 1
data: foo

event: barEvent
id: 2
data: bar

event: bazEvent
id: 3
data: baz
```

http://localhost:9080/ch4/rest/test/sse
```
result: foo bar baz
```

# END.
97 changes: 97 additions & 0 deletions Chapter04/pom.xml.liberty
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.packt.microprofile</groupId>
<artifactId>ch4</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<openliberty.maven.version>3.2</openliberty.maven.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<failOnMissingWebXml>false</failOnMissingWebXml>
<openliberty.version>[19.0.0.9,)</openliberty.version>
<final.name>ch4</final.name>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>4.0.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>ch4</finalName>
</build>
<profiles>
<profile>
<id>liberty</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>${openliberty.maven.version}</version>
<executions>
<execution>
<id>package-server</id>
<phase>package</phase>
<goals>
<goal>create</goal>
<goal>install-feature</goal>
<goal>deploy</goal>
<goal>package</goal>
</goals>
<configuration>
<outputDirectory>target/wlp-package</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<include>runnable</include>
<serverName>${final.name}</serverName>
<bootstrapProperties>
<project.name>${final.name}</project.name>
<jwt.issuer>https://server.example.com</jwt.issuer>
</bootstrapProperties>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-client</artifactId>
<version>0.34.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.25</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
75 changes: 75 additions & 0 deletions Chapter04/pom.xml.payara
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.packt.microprofile</groupId>
<artifactId>ch4</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.target>11</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<maven.compiler.source>11</maven.compiler.source>
<!--
NOTE: Version 6.2021.1.Alpha1 used on LATEST got rid of most probllems. One remains that @RestClient CDI injection does not work.
NOTE: Version 5.2021.1 till 5.2021.8 had even more trouble to do anything with the code so it is no option.
NOTE: It seems possible that the misleading documentation about @RestClient annoation to identify the Resource to be injected need to be looked into.
NOTE: Other micoprofile runtimes like liberty, wildfly and quarkus are working fine with the unchanged code base.

<payaraVersion>5.2021.1</payaraVersion>
-->
<payaraVersion>LATEST</payaraVersion>
<final.name>ch4</final.name>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>4.0.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-jwt</artifactId>
<version>3.9.5</version>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
<version>1.0.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>ch4</finalName>
</build>
<profiles>
<profile>
<id>payara-micro</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>fish.payara.maven.plugins</groupId>
<artifactId>payara-micro-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<payaraVersion>${payaraVersion}</payaraVersion>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading