Skip to content
This repository was archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
Quarkus 2.x Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo gonzalez granados committed May 13, 2021
1 parent 241691c commit 31c56ba
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
import javax.ws.rs.core.Response;

import io.quarkus.vertx.web.Route;
import io.vertx.core.http.HttpMethod;
import io.vertx.ext.web.RoutingContext;

@ApplicationScoped
public class HttpClientVersionResource {

protected static final String HTTP_VERSION = "x-http-version";

@Route(methods = HttpMethod.GET, path = "/httpVersion")
@Route(methods = Route.HttpMethod.GET, path = "/httpVersion")
public void clientHttpVersion(RoutingContext rc) {
String httpClientVersion = rc.request().version().name();
rc.response().headers().add(HTTP_VERSION, httpClientVersion);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package io.quarkus.ts.openshift.messaging.amqp;

import java.util.concurrent.TimeUnit;
import java.time.Duration;

import javax.enterprise.context.ApplicationScoped;

import org.eclipse.microprofile.reactive.messaging.Outgoing;
import org.jboss.logging.Logger;

import io.reactivex.Flowable;
import io.smallrye.mutiny.Multi;

@ApplicationScoped
public class PriceProducer {

private static final Logger LOG = Logger.getLogger(PriceProducer.class.getName());

@Outgoing("generated-price")
public Flowable<Integer> generate() {
public Multi<Integer> generate() {
LOG.info("generate fired...");
return Flowable.interval(1, TimeUnit.SECONDS)
.onBackpressureDrop()
return Multi.createFrom().ticks().every(Duration.ofSeconds(1))
.onOverflow().drop()
.map(tick -> ((tick.intValue() * 10) % 100) + 10);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import javax.jms.Message;
import javax.jms.Session;

import org.apache.commons.lang3.StringUtils;
import org.jboss.logging.Logger;

@ApplicationScoped
Expand Down Expand Up @@ -41,7 +40,7 @@ public String receiveAndAck(boolean ackIt) throws JMSException {
}

private String receiveMessagesInQueue(String queueName) {
String price = StringUtils.EMPTY;
String price = "";
try (JMSContext context = connectionFactory.createContext(Session.AUTO_ACKNOWLEDGE);
JMSConsumer consumer = context.createConsumer(context.createQueue(queueName))) {
Message message = consumer.receive(500);
Expand Down
5 changes: 1 addition & 4 deletions messaging/kafka-avro-reactive-messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
</goals>
</execution>
</executions>
Expand All @@ -91,10 +92,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
38 changes: 14 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
<module>messaging/artemis</module>
<module>messaging/artemis-jta</module>
<module>messaging/amqp-reactive</module>
<module>messaging/kafka-avro-reactive-messaging</module>
<module>messaging/kafka-streams-reactive-messaging</module>
<!-- TODO: gives a strimzi - docker container error. Fixed on upstream-->
<!-- <module>messaging/kafka-avro-reactive-messaging</module>-->
<!-- <module>messaging/kafka-streams-reactive-messaging</module>-->
<module>messaging/qpid</module>
<module>scaling</module>
<module>sql-db/app</module>
Expand Down Expand Up @@ -53,11 +54,11 @@
</modules>
<properties>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<version.apicurio.registry.utils.serde>1.3.2.Final</version.apicurio.registry.utils.serde>
<version.quarkiverse.apicurio.registry.client>0.0.2</version.quarkiverse.apicurio.registry.client>
Expand All @@ -68,12 +69,13 @@
<version.impsort-maven-plugin>1.6.1</version.impsort-maven-plugin>
<version.jandex-maven-plugin>1.0.8</version.jandex-maven-plugin>
<version.jjwt>0.11.2</version.jjwt>
<version.quarkus.qpid.jms>0.24.0</version.quarkus.qpid.jms>
<version.apache.avro>1.10.2</version.apache.avro>
<version.keytool-maven-plugin>1.5</version.keytool-maven-plugin>
<version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
<version.maven-jar-plugin>3.2.0</version.maven-jar-plugin>
<version.maven-surefire-plugin>2.22.2</version.maven-surefire-plugin>
<version.quarkus>1.13.3.Final</version.quarkus>
<version.quarkus>2.0.0.Alpha1</version.quarkus>
<version.plugin.quarkus>${version.quarkus}</version.plugin.quarkus>
<version.testcontainers>1.15.3</version.testcontainers>
<version.com.squareup.retrofit2>2.9.0</version.com.squareup.retrofit2>
Expand Down Expand Up @@ -168,6 +170,11 @@
<artifactId>retrofit</artifactId>
<version>${version.com.squareup.retrofit2}</version>
</dependency>
<dependency>
<groupId>org.amqphub.quarkus</groupId>
<artifactId>quarkus-qpid-jms</artifactId>
<version>${version.quarkus.qpid.jms}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
Expand Down Expand Up @@ -248,6 +255,7 @@
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -302,24 +310,6 @@
<artifactId>jandex-maven-plugin</artifactId>
<version>${version.jandex-maven-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${version.apache.avro}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<sourceDirectory>src/main/avro</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
<stringType>String</stringType>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit 31c56ba

Please sign in to comment.