diff --git a/Chapter04/README.liberty.md b/Chapter04/README.liberty.md new file mode 100644 index 0000000..125e68f --- /dev/null +++ b/Chapter04/README.liberty.md @@ -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. \ No newline at end of file diff --git a/Chapter04/README.payara.md b/Chapter04/README.payara.md new file mode 100644 index 0000000..1a7ff23 --- /dev/null +++ b/Chapter04/README.payara.md @@ -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. \ No newline at end of file diff --git a/Chapter04/README.quarkus.md b/Chapter04/README.quarkus.md new file mode 100644 index 0000000..3e711fa --- /dev/null +++ b/Chapter04/README.quarkus.md @@ -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. \ No newline at end of file diff --git a/Chapter04/README.wildfly.md b/Chapter04/README.wildfly.md new file mode 100644 index 0000000..780255c --- /dev/null +++ b/Chapter04/README.wildfly.md @@ -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. \ No newline at end of file diff --git a/Chapter04/pom.xml.liberty b/Chapter04/pom.xml.liberty new file mode 100644 index 0000000..a1abc1b --- /dev/null +++ b/Chapter04/pom.xml.liberty @@ -0,0 +1,97 @@ + + + 4.0.0 + com.packt.microprofile + ch4 + 1.0-SNAPSHOT + war + + 3.2 + 1.8 + 1.8 + false + [19.0.0.9,) + ch4 + + + + org.eclipse.microprofile + microprofile + 4.0.1 + pom + provided + + + org.glassfish + javax.json + 1.1.4 + + + org.eclipse + yasson + 1.0.8 + + + org.reactivestreams + reactive-streams + 1.0.3 + provided + + + + ch4 + + + + liberty + + true + + + + + io.openliberty.tools + liberty-maven-plugin + ${openliberty.maven.version} + + + package-server + package + + create + install-feature + deploy + package + + + target/wlp-package + + + + + runnable + ${final.name} + + ${final.name} + https://server.example.com + + + + + + + + io.jaegertracing + jaeger-client + 0.34.0 + + + org.slf4j + slf4j-jdk14 + 1.7.25 + + + + + diff --git a/Chapter04/pom.xml.payara b/Chapter04/pom.xml.payara new file mode 100644 index 0000000..3126851 --- /dev/null +++ b/Chapter04/pom.xml.payara @@ -0,0 +1,75 @@ + + + 4.0.0 + com.packt.microprofile + ch4 + 1.0-SNAPSHOT + war + + 11 + false + 11 + + LATEST + ch4 + + + + org.eclipse.microprofile + microprofile + 4.0.1 + pom + provided + + + io.vertx + vertx-auth-jwt + 3.9.5 + + + org.reactivestreams + reactive-streams + 1.0.3 + provided + + + + ch4 + + + + payara-micro + + true + + + + + fish.payara.maven.plugins + payara-micro-maven-plugin + 1.4.0 + + + package + + bundle + + + + + ${payaraVersion} + + + + + + + diff --git a/Chapter04/pom.xml.quarkus b/Chapter04/pom.xml.quarkus new file mode 100644 index 0000000..2413540 --- /dev/null +++ b/Chapter04/pom.xml.quarkus @@ -0,0 +1,149 @@ + + + 4.0.0 + com.packt.microprofile + ch4 + 1.0-SNAPSHOT + + 3.8.1 + true + 11 + 11 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 2.3.1.Final + 3.0.0-M5 + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + + + + io.quarkus + quarkus-resteasy-jaxb + + + io.quarkus + quarkus-resteasy-jsonb + + + io.quarkus + quarkus-resteasy-multipart + + + io.quarkus + quarkus-resteasy + + + + io.quarkus + quarkus-rest-client + + + io.quarkus + quarkus-rest-client-jackson + + + + io.quarkus + quarkus-resteasy-jackson + + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + ${maven.compiler.parameters} + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + native + + + native + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + + \ No newline at end of file diff --git a/Chapter04/pom.xml.wildfly b/Chapter04/pom.xml.wildfly new file mode 100644 index 0000000..01d2c1f --- /dev/null +++ b/Chapter04/pom.xml.wildfly @@ -0,0 +1,100 @@ + + + 4.0.0 + com.packt.microprofile + ch4 + 1.0-SNAPSHOT + war + + 11 + 25.0.0.Final + false + 11 + ch4 + + + + org.eclipse.microprofile + microprofile + 4.0.1 + pom + provided + + + io.vertx + vertx-auth-jwt + 3.9.5 + + + org.reactivestreams + reactive-streams + 1.0.3 + provided + + + + ch4 + + + + wildfly + + true + + + + + org.wildfly.plugins + wildfly-jar-maven-plugin + 6.0.0.Final + + + + package + + + + + wildfly@maven(org.jboss.universe:community-universe)#${version.wildfly} + false + + jaxrs + microprofile-platform + microprofile-config + microprofile-fault-tolerance + microprofile-health + microprofile-jwt + microprofile-metrics + microprofile-openapi + open-tracing + microprofile-rest-client + microprofile-reactive-messaging + + + + + + + + org.jboss.spec.javax.ws.rs + jboss-jaxrs-api_2.0_spec + 1.0.1.Final + provided + + + + + jboss-public-repository + JBoss Public Maven Repository Group + https://repository.jboss.org/nexus/content/groups/public/ + + + Red Hat GA + Red Hat GA + https://maven.repository.redhat.com/ga/ + + + + +