diff --git a/incubator/quarkus/image/project/pom.xml b/incubator/quarkus/image/project/pom.xml index f18a2163a..7aa3a1425 100644 --- a/incubator/quarkus/image/project/pom.xml +++ b/incubator/quarkus/image/project/pom.xml @@ -4,7 +4,7 @@ dev.appsody quarkus - 0.3.4 + 0.3.5 pom diff --git a/incubator/quarkus/stack.yaml b/incubator/quarkus/stack.yaml index f190481e2..97f8f0024 100644 --- a/incubator/quarkus/stack.yaml +++ b/incubator/quarkus/stack.yaml @@ -1,5 +1,5 @@ name: Quarkus -version: 0.3.4 +version: 0.3.5 description: Quarkus runtime for running Java applications license: Apache-2.0 language: java diff --git a/incubator/quarkus/templates/default/mvnw b/incubator/quarkus/templates/default/mvnw index 34d9dae8d..d2f0ea380 100755 --- a/incubator/quarkus/templates/default/mvnw +++ b/incubator/quarkus/templates/default/mvnw @@ -212,9 +212,9 @@ else echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." fi if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" fi while IFS="=" read key value; do case "$key" in (wrapperUrl) jarUrl="$value"; break ;; @@ -296,6 +296,11 @@ if $cygwin; then MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` fi +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ diff --git a/incubator/quarkus/templates/default/mvnw.cmd b/incubator/quarkus/templates/default/mvnw.cmd index 77b451d83..b26ab24f0 100755 --- a/incubator/quarkus/templates/default/mvnw.cmd +++ b/incubator/quarkus/templates/default/mvnw.cmd @@ -37,7 +37,7 @@ @echo off @REM set title of command window title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME @@ -120,7 +120,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B @@ -129,14 +129,18 @@ FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven- @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) ) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" - ) - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + powershell -Command "&{"^ "$webclient = new-object System.Net.WebClient;"^ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ @@ -144,10 +148,16 @@ if exist %WRAPPER_JAR% ( "}"^ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ "}" - echo Finished downloading %WRAPPER_JAR% + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) ) @REM End of extension +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end diff --git a/incubator/quarkus/templates/default/src/main/resources/META-INF/resources/index.html b/incubator/quarkus/templates/default/src/main/resources/META-INF/resources/index.html index d4134a156..1ff33a7e6 100644 --- a/incubator/quarkus/templates/default/src/main/resources/META-INF/resources/index.html +++ b/incubator/quarkus/templates/default/src/main/resources/META-INF/resources/index.html @@ -105,7 +105,7 @@
-

Congratulations, you have created a new Quarkus application.

+

Congratulations, you have created a new Quarkus application.

Why do you see this?

@@ -114,13 +114,13 @@

Why do you see this?

What can I do from here?

-

If not already done, run the application in dev mode using: mvn compile quarkus:dev. +

If not already done, run the application in dev mode using: mvn quarkus:dev.

    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/META-INF/microprofile-config.properties. -
  • +
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • +
  • Your static assets are located in src/main/resources/META-INF/resources.
  • +
  • Configure your application in src/main/resources/application.properties. +

How do I get rid of this page?

@@ -133,7 +133,7 @@

Application

  • GroupId: org.acme
  • ArtifactId: getting-started
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 1.3.2.Final
  • +
  • Quarkus Version: 0.11.0
  • diff --git a/incubator/quarkus/templates/kafka/docker-compose.yaml b/incubator/quarkus/templates/kafka/docker-compose.yaml index 7f63a88b4..6973aab05 100644 --- a/incubator/quarkus/templates/kafka/docker-compose.yaml +++ b/incubator/quarkus/templates/kafka/docker-compose.yaml @@ -3,7 +3,7 @@ version: '2' services: zookeeper: - image: strimzi/kafka:0.15.0-kafka-2.3.1 + image: strimzi/kafka:0.11.3-kafka-2.1.0 command: [ "sh", "-c", "bin/zookeeper-server-start.sh config/zookeeper.properties" @@ -14,7 +14,7 @@ services: LOG_DIR: /tmp/logs kafka: - image: strimzi/kafka:0.15.0-kafka-2.3.1 + image: strimzi/kafka:0.11.3-kafka-2.1.0 command: [ "sh", "-c", "bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}" diff --git a/incubator/quarkus/templates/kafka/mvnw b/incubator/quarkus/templates/kafka/mvnw index 34d9dae8d..d2f0ea380 100755 --- a/incubator/quarkus/templates/kafka/mvnw +++ b/incubator/quarkus/templates/kafka/mvnw @@ -212,9 +212,9 @@ else echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." fi if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" fi while IFS="=" read key value; do case "$key" in (wrapperUrl) jarUrl="$value"; break ;; @@ -296,6 +296,11 @@ if $cygwin; then MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` fi +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ diff --git a/incubator/quarkus/templates/kafka/mvnw.cmd b/incubator/quarkus/templates/kafka/mvnw.cmd index 77b451d83..b26ab24f0 100755 --- a/incubator/quarkus/templates/kafka/mvnw.cmd +++ b/incubator/quarkus/templates/kafka/mvnw.cmd @@ -37,7 +37,7 @@ @echo off @REM set title of command window title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME @@ -120,7 +120,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B @@ -129,14 +129,18 @@ FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven- @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) ) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar" - ) - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + powershell -Command "&{"^ "$webclient = new-object System.Net.WebClient;"^ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ @@ -144,10 +148,16 @@ if exist %WRAPPER_JAR% ( "}"^ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ "}" - echo Finished downloading %WRAPPER_JAR% + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) ) @REM End of extension +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end diff --git a/incubator/quarkus/templates/kafka/pom.xml b/incubator/quarkus/templates/kafka/pom.xml index fd12fe295..0b78326c1 100644 --- a/incubator/quarkus/templates/kafka/pom.xml +++ b/incubator/quarkus/templates/kafka/pom.xml @@ -1,117 +1,132 @@ - - - 4.0.0 + + + 4.0.0 - - dev.appsody - quarkus - [0.3,0.4) - + + dev.appsody + quarkus + [0.3,0.4) + - org.acme - kafka-quickstart - 1.0-SNAPSHOT - - - - io.quarkus - quarkus-smallrye-metrics - - - io.quarkus - quarkus-resteasy - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - io.quarkus - quarkus-smallrye-reactive-messaging-kafka - - - - + org.acme + kafka-quickstart + 1.0-SNAPSHOT + + + + io.quarkus + quarkus-smallrye-metrics + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-smallrye-reactive-messaging-kafka + + + io.quarkus + quarkus-junit5 + test + + + org.jboss.resteasy + resteasy-client + test + + + io.rest-assured + rest-assured + test + + + org.awaitility + awaitility + test + + + org.testcontainers + kafka + 1.12.3 + test + + + org.testcontainers + junit-jupiter + test + + + + + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + + + + build + + + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + + + + + + + + native + + + native + + + - - maven-compiler-plugin - ${compiler-plugin.version} - - - maven-surefire-plugin - ${surefire-plugin.version} + + io.quarkus + quarkus-maven-plugin + ${quarkus-plugin.version} + + + + native-image + + + true + + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + - - org.jboss.logmanager.LogManager - + + ${project.build.directory}/${project.build.finalName}-runner + - - - io.quarkus - quarkus-maven-plugin - ${quarkus-plugin.version} - - - - build - - - - + + + - - - - - - native - - - native - - - - - - io.quarkus - quarkus-maven-plugin - ${quarkus-plugin.version} - - - - native-image - - - true - - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - ${project.build.directory}/${project.build.finalName}-runner - - - - - - - - - + + + diff --git a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceConverter.java b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceConverter.java index e7cc678e5..dc87c69f5 100644 --- a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceConverter.java +++ b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceConverter.java @@ -1,10 +1,11 @@ package org.acme.kafka; -import io.smallrye.reactive.messaging.annotations.Broadcast; +import javax.enterprise.context.ApplicationScoped; + import org.eclipse.microprofile.reactive.messaging.Incoming; import org.eclipse.microprofile.reactive.messaging.Outgoing; -import javax.enterprise.context.ApplicationScoped; +import io.smallrye.reactive.messaging.annotations.Broadcast; /** * A bean consuming data from the "prices" Kafka topic and applying some conversion. @@ -15,9 +16,9 @@ public class PriceConverter { private static final double CONVERSION_RATE = 0.88; - @Incoming("prices") - @Outgoing("my-data-stream") - @Broadcast + @Incoming("prices") + @Outgoing("my-data-stream") + @Broadcast public double process(int priceInUsd) { return priceInUsd * CONVERSION_RATE; } diff --git a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceGenerator.java b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceGenerator.java index e7f2e56cd..b1f38bab5 100644 --- a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceGenerator.java +++ b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceGenerator.java @@ -1,12 +1,14 @@ package org.acme.kafka; -import io.reactivex.Flowable; -import org.eclipse.microprofile.reactive.messaging.Outgoing; - -import javax.enterprise.context.ApplicationScoped; import java.util.Random; import java.util.concurrent.TimeUnit; +import javax.enterprise.context.ApplicationScoped; + +import org.eclipse.microprofile.reactive.messaging.Outgoing; + +import io.reactivex.Flowable; + /** * A bean producing random prices every 5 seconds. * The prices are written to a Kafka topic (prices). The Kafka configuration is specified in the application configuration. @@ -16,8 +18,8 @@ public class PriceGenerator { private Random random = new Random(); - @Outgoing("generated-price") - public Flowable generate() { + @Outgoing("generated-price") + public Flowable generate() { return Flowable.interval(5, TimeUnit.SECONDS) .map(tick -> random.nextInt(100)); } diff --git a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceResource.java b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceResource.java index 835eb9753..da55537bd 100644 --- a/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceResource.java +++ b/incubator/quarkus/templates/kafka/src/main/java/org/acme/kafka/PriceResource.java @@ -1,29 +1,31 @@ package org.acme.kafka; -import io.smallrye.reactive.messaging.annotations.Channel; -import org.reactivestreams.Publisher; - import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; + import org.jboss.resteasy.annotations.SseElementType; +import org.reactivestreams.Publisher; + +import io.smallrye.reactive.messaging.annotations.Channel; /** - * A simple resource retrieving the in-memory "my-data-stream" and sending the items as server-sent events. + * A simple resource retrieving the "in-memory" "my-data-stream" and sending the items to a server sent event. */ @Path("/prices") public class PriceResource { @Inject - @Channel("my-data-stream") Publisher prices; + @Channel("my-data-stream") + Publisher prices; @GET @Path("/stream") - @Produces(MediaType.SERVER_SENT_EVENTS) - @SseElementType("text/plain") - public Publisher stream() { + @Produces(MediaType.SERVER_SENT_EVENTS) // denotes that server side events (SSE) will be produced + @SseElementType("text/plain") // denotes that the contained data, within this SSE, is just regular text/plain data + public Publisher stream() { return prices; } } diff --git a/incubator/quarkus/templates/kafka/src/main/resources/META-INF/resources/prices.html b/incubator/quarkus/templates/kafka/src/main/resources/META-INF/resources/prices.html index 1506df556..b09615ca1 100644 --- a/incubator/quarkus/templates/kafka/src/main/resources/META-INF/resources/prices.html +++ b/incubator/quarkus/templates/kafka/src/main/resources/META-INF/resources/prices.html @@ -25,4 +25,4 @@

    Last price

    document.getElementById("content").innerHTML = event.data; }; - + \ No newline at end of file diff --git a/incubator/quarkus/templates/kafka/src/main/resources/application.properties b/incubator/quarkus/templates/kafka/src/main/resources/application.properties index 94a758b8c..5dc64e3d4 100644 --- a/incubator/quarkus/templates/kafka/src/main/resources/application.properties +++ b/incubator/quarkus/templates/kafka/src/main/resources/application.properties @@ -5,4 +5,5 @@ mp.messaging.outgoing.generated-price.value.serializer=org.apache.kafka.common.s # Configure the Kafka source (we read from it) mp.messaging.incoming.prices.connector=smallrye-kafka +mp.messaging.incoming.prices.topic=prices mp.messaging.incoming.prices.value.deserializer=org.apache.kafka.common.serialization.IntegerDeserializer