Skip to content

Commit

Permalink
Update to Vert.x 4.2.1 and related projects.
Browse files Browse the repository at this point in the history
Dependencies:

- Update to Vert.x 4.2.1
- Update to Stork 1.0.0.Beta1
- Update to Vert.x Mutiny Bindings 2.15.0
- Update to Quarkus HTTP 4.1.4

Core and HTTP:

- New cookie-related methods
- Relocation of the CACHE_DIR_BASE_PROP_NAME constant
- Update native image configuration for Vert.x

Data Source:

- New preparedQuery method in Pool

Redis:

- Signature changes of the lpop, psync and rpop command
- The workaround done in Quarkus does not break compatibility

Amazon Lambda:

- Relocation of the CACHE_DIR_BASE_PROP_NAME constant
  • Loading branch information
cescoffier committed Nov 4, 2021
1 parent 7c22995 commit c6e525d
Show file tree
Hide file tree
Showing 24 changed files with 250 additions and 48 deletions.
8 changes: 4 additions & 4 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<opentelemetry.version>1.7.0</opentelemetry.version>
<opentelemetry-alpha.version>1.7.0-alpha</opentelemetry-alpha.version>
<jaeger.version>1.6.0</jaeger.version>
<quarkus-http.version>4.1.3</quarkus-http.version>
<quarkus-http.version>4.1.4</quarkus-http.version>
<micrometer.version>1.7.5</micrometer.version>
<google-auth.version>0.22.0</google-auth.version>
<microprofile-config-api.version>2.0</microprofile-config-api.version>
Expand All @@ -53,9 +53,9 @@
<smallrye-context-propagation.version>1.2.2</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>2.6.0</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>2.14.1</smallrye-mutiny-vertx-binding.version>
<smallrye-mutiny-vertx-binding.version>2.15.0</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>3.10.1</smallrye-reactive-messaging.version>
<smallrye-stork.version>1.0.0.Alpha7</smallrye-stork.version>
<smallrye-stork.version>1.0.0.Beta1</smallrye-stork.version>
<jakarta.activation.version>1.2.1</jakarta.activation.version>
<jakarta.annotation-api.version>1.3.5</jakarta.annotation-api.version>
<jakarta.el-impl.version>3.0.4</jakarta.el-impl.version>
Expand Down Expand Up @@ -108,7 +108,7 @@
<wildfly-elytron.version>1.17.2.Final</wildfly-elytron.version>
<jboss-modules.version>1.8.7.Final</jboss-modules.version>
<jboss-threads.version>3.4.2.Final</jboss-threads.version>
<vertx.version>4.1.5</vertx.version>
<vertx.version>4.2.1</vertx.version>
<httpclient.version>4.5.13</httpclient.version>
<httpcore.version>4.4.14</httpcore.version>
<httpasync.version>4.1.4</httpasync.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.amazon.lambda.http.deployment;

import static io.vertx.core.file.impl.FileResolverImpl.CACHE_DIR_BASE_PROP_NAME;

import org.jboss.logging.Logger;

import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent;
Expand All @@ -20,7 +22,6 @@
import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;
import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;
import io.quarkus.vertx.http.deployment.RequireVirtualHttpBuildItem;
import io.vertx.core.file.impl.FileResolver;

public class AmazonLambdaHttpProcessor {
private static final Logger log = Logger.getLogger(AmazonLambdaHttpProcessor.class);
Expand Down Expand Up @@ -67,7 +68,7 @@ public void registerReflectionClasses(BuildProducer<ReflectiveClassBuildItem> re
*/
@BuildStep
void setTempDir(BuildProducer<SystemPropertyBuildItem> systemProperty) {
systemProperty.produce(new SystemPropertyBuildItem(FileResolver.CACHE_DIR_BASE_PROP_NAME, "/tmp/quarkus"));
systemProperty.produce(new SystemPropertyBuildItem(CACHE_DIR_BASE_PROP_NAME, "/tmp/quarkus"));
}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.amazon.lambda.http.deployment;

import static io.vertx.core.file.impl.FileResolverImpl.CACHE_DIR_BASE_PROP_NAME;

import org.jboss.logging.Logger;

import io.quarkus.amazon.lambda.deployment.LambdaUtil;
Expand All @@ -25,7 +27,6 @@
import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;
import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;
import io.quarkus.vertx.http.deployment.RequireVirtualHttpBuildItem;
import io.vertx.core.file.impl.FileResolver;

public class AmazonLambdaHttpProcessor {
private static final Logger log = Logger.getLogger(AmazonLambdaHttpProcessor.class);
Expand Down Expand Up @@ -74,7 +75,7 @@ public void registerReflectionClasses(BuildProducer<ReflectiveClassBuildItem> re
*/
@BuildStep
void setTempDir(BuildProducer<SystemPropertyBuildItem> systemProperty) {
systemProperty.produce(new SystemPropertyBuildItem(FileResolver.CACHE_DIR_BASE_PROP_NAME, "/tmp/quarkus"));
systemProperty.produce(new SystemPropertyBuildItem(CACHE_DIR_BASE_PROP_NAME, "/tmp/quarkus"));
}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.sqlclient.Pool;
import io.vertx.sqlclient.PrepareOptions;
import io.vertx.sqlclient.PreparedQuery;
import io.vertx.sqlclient.Query;
import io.vertx.sqlclient.Row;
Expand All @@ -33,6 +34,11 @@ public PreparedQuery<RowSet<Row>> preparedQuery(String s) {
return null;
}

@Override
public PreparedQuery<RowSet<Row>> preparedQuery(String sql, PrepareOptions options) {
return null;
}

@Override
public Future<SqlConnection> getConnection() {
Promise<SqlConnection> promise = Promise.promise();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ static RedisClient createClient(String name) {

Response lpop(String arg0);

Response lpop(List<String> args);

Response lpush(List<String> args);

Response lpushx(List<String> args);
Expand Down Expand Up @@ -244,6 +246,8 @@ static RedisClient createClient(String name) {

Response psync(String arg0, String arg1);

Response psync(List<String> args);

Response pttl(String arg0);

Response publish(String arg0, String arg1);
Expand Down Expand Up @@ -274,6 +278,8 @@ static RedisClient createClient(String name) {

Response rpop(String arg0);

Response rpop(List<String> args);

Response rpoplpush(String arg0, String arg1);

Response rpush(List<String> args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,12 @@ static ReactiveRedisClient createClient(String name) {

Uni<Response> lpop(String arg0);

Uni<Response> lpop(List<String> arg0);

Response lpopAndAwait(String arg0);

Response lpopAndAwait(List<String> arg0);

Uni<Response> lpush(List<String> args);

Response lpushAndAwait(List<String> args);
Expand Down Expand Up @@ -448,8 +452,12 @@ static ReactiveRedisClient createClient(String name) {

Uni<Response> psync(String arg0, String arg1);

Uni<Response> psync(List<String> args);

Response psyncAndAwait(String arg0, String arg1);

Response psyncAndAwait(List<String> args);

Uni<Response> pttl(String arg0);

Response pttlAndAwait(String arg0);
Expand Down Expand Up @@ -508,8 +516,12 @@ static ReactiveRedisClient createClient(String name) {

Uni<Response> rpop(String arg0);

Uni<Response> rpop(List<String> args);

Response rpopAndAwait(String arg0);

Response rpopAndAwait(List<String> args);

Uni<Response> rpoplpush(String arg0, String arg1);

Response rpoplpushAndAwait(String arg0, String arg1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,21 @@ public Response lolwutAndAwait(List<String> args) {

@Override
public Uni<Response> lpop(String arg0) {
return redisAPI.lpop(List.of(arg0));
}

@Override
public Uni<Response> lpop(List<String> arg0) {
return redisAPI.lpop(arg0);
}

@Override
public Response lpopAndAwait(String arg0) {
return redisAPI.lpopAndAwait(List.of(arg0));
}

@Override
public Response lpopAndAwait(List<String> arg0) {
return redisAPI.lpopAndAwait(arg0);
}

Expand Down Expand Up @@ -1041,12 +1051,22 @@ public Response psubscribeAndAwait(List<String> args) {

@Override
public Uni<Response> psync(String arg0, String arg1) {
return redisAPI.psync(arg0, arg1);
return redisAPI.psync(List.of(arg0, arg1));
}

@Override
public Uni<Response> psync(List<String> args) {
return redisAPI.psync(args);
}

@Override
public Response psyncAndAwait(List<String> args) {
return redisAPI.psyncAndAwait(args);
}

@Override
public Response psyncAndAwait(String arg0, String arg1) {
return redisAPI.psyncAndAwait(arg0, arg1);
return redisAPI.psyncAndAwait(List.of(arg0, arg1));
}

@Override
Expand Down Expand Up @@ -1191,12 +1211,22 @@ public Response roleAndAwait() {

@Override
public Uni<Response> rpop(String arg0) {
return redisAPI.rpop(arg0);
return redisAPI.rpop(List.of(arg0));
}

@Override
public Uni<Response> rpop(List<String> args) {
return redisAPI.rpop(args);
}

@Override
public Response rpopAndAwait(List<String> args) {
return redisAPI.rpopAndAwait(args);
}

@Override
public Response rpopAndAwait(String arg0) {
return redisAPI.rpopAndAwait(arg0);
return redisAPI.rpopAndAwait(List.of(arg0));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,12 @@ public Response lolwut(List<String> args) {

@Override
public Response lpop(String arg0) {
return await(redisAPI.lpop(arg0));
return await(redisAPI.lpop(List.of(arg0)));
}

@Override
public Response lpop(List<String> args) {
return await(redisAPI.lpop(args));
}

@Override
Expand Down Expand Up @@ -534,7 +539,12 @@ public Response psubscribe(List<String> args) {

@Override
public Response psync(String arg0, String arg1) {
return await(redisAPI.psync(arg0, arg1));
return await(redisAPI.psync(List.of(arg0, arg1)));
}

@Override
public Response psync(List<String> args) {
return await(redisAPI.psync(args));
}

@Override
Expand Down Expand Up @@ -609,7 +619,12 @@ public Response role() {

@Override
public Response rpop(String arg0) {
return await(redisAPI.rpop(arg0));
return await(redisAPI.rpop(List.of(arg0)));
}

@Override
public Response rpop(List<String> args) {
return await(redisAPI.rpop(args));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Handler<RoutingContext> handler() {
return new Handler<RoutingContext>() {
@Override
public void handle(RoutingContext event) {
if (event.normalisedPath().length() == (event.currentRoute().getPath().length()
if (event.normalizedPath().length() == (event.currentRoute().getPath().length()
+ (event.mountPoint() == null ? 0 : event.mountPoint().length() - 1))) {
event.response().setStatusCode(302);
event.response().headers().set(HttpHeaders.LOCATION, (event.mountPoint() == null ? "" : event.mountPoint())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package io.quarkus.vertx.http.devconsole;

import java.net.URL;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.test.common.http.TestHTTPResource;
import io.restassured.RestAssured;

/**
Expand All @@ -21,25 +24,28 @@ public class DevConsoleConfigEditorBodyHandlerTest {
static final QuarkusDevModeTest config = new QuarkusDevModeTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClass(BodyHandlerBean.class));

@TestHTTPResource
URL url;

@Test
public void testChangeHttpRoute() {
RestAssured.with()
.get("q/arc/beans")
.get("http://localhost:" + url.getPort() + "/q/arc/beans")
.then()
.statusCode(200);
RestAssured.with().formParam("name", "quarkus.http.root-path")
.formParam("value", "/foo")
.formParam("action", "updateProperty")
.redirects().follow(false)
.post("q/dev/io.quarkus.quarkus-vertx-http/config")
.post("http://localhost:" + url.getPort() + "/q/dev/io.quarkus.quarkus-vertx-http/config")
.then()
.statusCode(303);
RestAssured.with()
.get("q/arc/beans")
.get("http://localhost:" + url.getPort() + "/q/arc/beans")
.then()
.statusCode(404);
RestAssured.with()
.get("foo/q/arc/beans")
.get("http://localhost:" + url.getPort() + "/foo/q/arc/beans")
.then()
.statusCode(200);

Expand Down
Loading

0 comments on commit c6e525d

Please sign in to comment.