From d245d19445b641c4fa1565ede75bd78a73ceb9a8 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Fri, 22 Jan 2021 18:14:30 +0100 Subject: [PATCH] Remove Vert.x Axle and Vert.x RX managed instances These features have been deprecated in February 2020. It also simplifies the Vert.x 4 migration, as it reduces the API surface. --- bom/application/pom.xml | 81 +----- build-parent/pom.xml | 1 - docs/src/main/asciidoc/mailer.adoc | 2 - docs/src/main/asciidoc/reactive-routes.adoc | 6 +- docs/src/main/asciidoc/vertx.adoc | 45 +-- .../java/io/quarkus/mailer/InjectionTest.java | 37 +-- extensions/mailer/runtime/pom.xml | 4 - .../mailer/runtime/MailClientProducer.java | 20 -- .../test/java/io/quarkus/mailer/MailTest.java | 14 - .../mailer/runtime/MailerImplTest.java | 6 +- .../channels/ChannelConsumer.java | 12 +- .../channels/DeprecatedChannelConsumer.java | 13 +- .../hotreload/SomeSource.java | 15 +- .../runtime/pom.xml | 4 - .../vertx/web/deployment/DotNames.java | 11 +- .../web/deployment/HandlerDescriptor.java | 8 - .../quarkus/vertx/web/deployment/Methods.java | 13 +- .../web/deployment/VertxWebProcessor.java | 37 +-- .../io/quarkus/vertx/web/SimpleRouteTest.java | 7 - .../vertx/web/mutiny/MultiRouteTest.java | 7 - .../vertx/web/mutiny/SSEMultiRouteTest.java | 11 - .../vertx/web/mutiny/SyncRouteTest.java | 8 - .../vertx/web/mutiny/UniRouteTest.java | 6 - .../web/params/RouteMethodParametersTest.java | 17 +- .../main/java/io/quarkus/vertx/web/Route.java | 6 +- .../vertx/web/runtime/MultiSseSupport.java | 9 - .../vertx/web/runtime/MultiSupport.java | 9 - .../deployment/EventBusCodecProcessor.java | 16 +- .../vertx/deployment/EventBusConsumer.java | 53 ---- .../vertx/deployment/VertxConstants.java | 4 - .../vertx/deployment/VertxProcessor.java | 6 - .../vertx/AxleCodecRegistrationTest.java | 256 ------------------ .../java/io/quarkus/vertx/AxleCodecTest.java | 95 ------- .../io/quarkus/vertx/VertxInjectionTest.java | 16 -- .../deployment/MessageConsumerMethodTest.java | 30 -- .../vertx/deployment/VertxProducerTest.java | 41 --- extensions/vertx/runtime/pom.xml | 28 -- .../quarkus/vertx/runtime/VertxProducer.java | 46 +--- .../vertx/runtime/VertxProducerTest.java | 8 - .../it/amazon/lambda/GreetingVertx.java | 13 - .../reactive/ReactiveStreamOpsResource.java | 6 +- .../ReactiveStreamsOperatorsTestCase.java | 4 +- integration-tests/vertx/pom.xml | 17 ++ .../io/quarkus/it/vertx/EventBusSender.java | 16 +- .../it/vertx/VertxProducerResource.java | 17 +- .../it/vertx/verticles/RxVerticle.java | 16 -- .../it/vertx/verticles/VerticleDeployer.java | 18 +- .../it/vertx/verticles/VerticleEndpoint.java | 37 +-- .../io/quarkus/it/vertx/VerticleTest.java | 12 - .../io/quarkus/it/virtual/GreetingVertx.java | 13 - .../io/quarkus/it/virtual/FunctionTest.java | 3 - 51 files changed, 134 insertions(+), 1046 deletions(-) delete mode 100644 extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecRegistrationTest.java delete mode 100644 extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecTest.java delete mode 100644 integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/RxVerticle.java diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 1a539f927ba65..842853d17ff0c 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -137,8 +137,7 @@ 1.0.3 3.4.1.Final 0.13.0 - 1.4.0 - 1.4.0 + 1.4.0 2.5.0 3.5.7 @@ -4040,45 +4039,10 @@ - - io.smallrye.reactive - smallrye-axle-generator - ${axle-client.version} - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-core - - - - - io.smallrye.reactive - smallrye-axle-amqp-client - ${axle-client.version} - - - io.smallrye.reactive - smallrye-axle-core - ${axle-client.version} - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-core - - - io.smallrye.reactive smallrye-mutiny-vertx-core - ${mutiny-client.version} + ${mutiny-vertx.version} com.fasterxml.jackson.core @@ -4090,35 +4054,30 @@ - - io.smallrye.reactive - smallrye-axle-web-client - ${axle-client.version} - io.smallrye.reactive smallrye-mutiny-vertx-web-client - ${mutiny-client.version} + ${mutiny-vertx.version} io.smallrye.reactive smallrye-mutiny-vertx-sql-client - ${mutiny-client.version} + ${mutiny-vertx.version} io.smallrye.reactive smallrye-mutiny-vertx-db2-client - ${mutiny-client.version} + ${mutiny-vertx.version} io.smallrye.reactive smallrye-mutiny-vertx-mysql-client - ${mutiny-client.version} + ${mutiny-vertx.version} io.smallrye.reactive smallrye-mutiny-vertx-pg-client - ${mutiny-client.version} + ${mutiny-vertx.version} @@ -4126,35 +4085,15 @@ client ${scram-client.version} - - io.smallrye.reactive - smallrye-axle-mail-client - ${axle-client.version} - - + io.smallrye.reactive smallrye-mutiny-vertx-mail-client - ${mutiny-client.version} + ${mutiny-vertx.version} io.smallrye.reactive smallrye-mutiny-vertx-redis-client - ${mutiny-client.version} - - - io.vertx - vertx-rx-java2 - ${vertx.version} - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-core - - + ${mutiny-vertx.version} io.vertx diff --git a/build-parent/pom.xml b/build-parent/pom.xml index eea5d104448ca..a810d892f6422 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -37,7 +37,6 @@ 20.3.1 20.3 4.3.2 - 1.1.0 1.1.0 3.9.2 diff --git a/docs/src/main/asciidoc/mailer.adoc b/docs/src/main/asciidoc/mailer.adoc index c2b15e69ef543..321005827988f 100644 --- a/docs/src/main/asciidoc/mailer.adoc +++ b/docs/src/main/asciidoc/mailer.adoc @@ -411,8 +411,6 @@ If you need fine control on how the mail is sent, for instance if you need to re Three API flavors are exposed: * the Mutiny client (`io.vertx.mutiny.ext.mail.MailClient`) -* the Axle client (`io.vertx.axle.ext.mail.MailClient`), using `CompletionStage` and Reactive Streams `Publisher` - deprecated, it is recommended to switch to the Mutiny client -* the RX Java 2 client (`io.vertx.reactivex.ext.mail.MailClient`) - deprecated, it is recommended to switch to the Mutiny client * the bare client (`io.vertx.ext.mail.MailClient`) Check the link:vertx[Using Vert.x guide] for further details about these different APIs and how to select the most suitable for you. diff --git a/docs/src/main/asciidoc/reactive-routes.adoc b/docs/src/main/asciidoc/reactive-routes.adoc index 7466116e8e5bc..cda96a21da55c 100644 --- a/docs/src/main/asciidoc/reactive-routes.adoc +++ b/docs/src/main/asciidoc/reactive-routes.adoc @@ -206,12 +206,12 @@ Some methods of `RoutingExchange` do it for you, others not and you must call th A route method can accept arguments of the following types: * `io.vertx.ext.web.RoutingContext` -* `io.vertx.reactivex.ext.web.RoutingContext` +* `io.vertx.mutiny.ext.web.RoutingContext` * `io.quarkus.vertx.web.RoutingExchange` * `io.vertx.core.http.HttpServerRequest` * `io.vertx.core.http.HttpServerResponse` -* `io.vertx.reactivex.core.http.HttpServerRequest` -* `io.vertx.reactivex.core.http.HttpServerResponse` +* `io.vertx.mutiny.core.http.HttpServerRequest` +* `io.vertx.mutiny.core.http.HttpServerResponse` Furthermore, it is possible to inject the `HttpServerRequest` parameters into a method parameter annotated with `@io.quarkus.vertx.web.Param`: diff --git a/docs/src/main/asciidoc/vertx.adoc b/docs/src/main/asciidoc/vertx.adoc index 8267ed74221b8..25c5ea291f800 100644 --- a/docs/src/main/asciidoc/vertx.adoc +++ b/docs/src/main/asciidoc/vertx.adoc @@ -133,9 +133,9 @@ Once the extension has been added, you can access the _managed_ Vert.x instance ---- If you are familiar with Vert.x, you know that Vert.x provides different API models. -For instance _bare_ Vert.x uses callbacks, the Mutiny variants uses `Uni` and `Multi`, the RX Java 2 version uses `Single`, `Maybe`, `Completable`, `Observable` and `Flowable`... +The _bare_ Vert.x uses callbacks, while the Mutiny variant uses `Uni` and `Multi`. -Quarkus provides 4 Vert.x APIs: +Quarkus provides 2 Vert.x APIs: [options="header"] |=== @@ -146,21 +146,15 @@ Quarkus provides 4 Vert.x APIs: | https://smallrye.io/smallrye-mutiny/[Mutiny] | `@Inject io.vertx.mutiny.core.Vertx vertx` | The Mutiny API for Vert.x. -| RX Java 2 | `@Inject io.vertx.reactivex.core.Vertx vertx` | RX Java 2 Vert.x, the API uses RX Java 2 types (deprecated). - -| _Axle_ | `@Inject io.vertx.axle.core.Vertx vertx` | Axle Vert.x, the API uses `CompletionStage` and `Reactive Streams` (deprecated). - |=== -TIP: You may inject any of the 4 flavors of `Vertx` as well as the `EventBus` in your Quarkus application beans: `bare`, `Mutiny`, `Axle`, `RxJava2`. +TIP: You may inject any of the 2 flavors of `Vertx` as well as the `EventBus` in your Quarkus application beans: `bare` and `Mutiny`. They are just shims and rely on a single _managed_ Vert.x instance. You will pick one or the other depending on your use cases. - `bare`: for advanced usage or if you have existing Vert.x code you want to reuse in your Quarkus application - `mutiny`: Mutiny is an event-driven reactive programming API. It uses 2 types: `Uni` and `Multi`. This is the recommended API. -- `Axle`: works well with Quarkus and MicroProfile APIs (`CompletionStage` for single results and `Publisher` for streams) - deprecated, it is recommended to switch to Mutiny -- `Rx Java 2`: when you need support for a wide range of data transformation operators on your streams - deprecated, it is recommended to switch to Mutiny The following snippets illustrate the difference between these 4 APIs: @@ -183,25 +177,6 @@ vertx.fileSystem().readFile("lorem-ipsum.txt") content -> System.out.println("Content: " + content), err -> System.out.println("Cannot read the file: " + err.getMessage()) ); - -// Rx Java 2 Vert.x -vertx.fileSystem().rxReadFile("lorem-ipsum.txt") - .map(buffer -> buffer.toString("UTF-8")) - .subscribe( - content -> System.out.println("Content: " + content), - err -> System.out.println("Cannot read the file: " + err.getMessage()) - ); - -// Axle API: -vertx.fileSystem().readFile("lorem-ipsum.txt") - .thenApply(buffer -> buffer.toString("UTF-8")) - .whenComplete((content, err) -> { - if (err != null) { - System.out.println("Cannot read the file: " + err.getMessage()); - } else { - System.out.println("Content: " + content); - } - }); ---- [TIP] @@ -465,22 +440,8 @@ Depending on the API model you want to use you need to add the right dependency io.smallrye.reactive smallrye-mutiny-vertx-web-client - - - - io.smallrye.reactive - smallrye-axle-web-client - - - - - io.vertx - vertx-rx-java2 - ---- -NOTE: The `vertx-rx-java2` provides the RX Java 2 API for the whole Vert.x stack, not only the web client. - In this guide, we are going to use the Mutiny API, so: [source, xml, subs=attributes+] diff --git a/extensions/mailer/deployment/src/test/java/io/quarkus/mailer/InjectionTest.java b/extensions/mailer/deployment/src/test/java/io/quarkus/mailer/InjectionTest.java index db1ca519064e2..76b0bb49ddf26 100644 --- a/extensions/mailer/deployment/src/test/java/io/quarkus/mailer/InjectionTest.java +++ b/extensions/mailer/deployment/src/test/java/io/quarkus/mailer/InjectionTest.java @@ -27,9 +27,8 @@ public class InjectionTest { @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(BeanUsingAxleMailClient.class, BeanUsingBareMailClient.class, BeanUsingRxClient.class) - .addClasses(BeanUsingBlockingMailer.class, BeanUsingReactiveMailer.class) - .addClasses(MailTemplates.class) + .addClasses(BeanUsingBareMailClient.class, BeanUsingBlockingMailer.class, + BeanUsingReactiveMailer.class, MailTemplates.class) .addAsResource("mock-config.properties", "application.properties") .addAsResource(new StringAsset("" + "{name}"), "templates/test1.html") @@ -43,13 +42,7 @@ public class InjectionTest { + "{name}"), "templates/mails/test2.html")); @Inject - BeanUsingAxleMailClient beanUsingBare; - - @Inject - BeanUsingBareMailClient beanUsingAxle; - - @Inject - BeanUsingRxClient beanUsingRx; + BeanUsingBareMailClient beanUsingBare; @Inject BeanUsingMutinyClient beanUsingMutiny; @@ -69,9 +62,7 @@ public class InjectionTest { @Test public void testInjection() { beanUsingMutiny.verify(); - beanUsingAxle.verify(); beanUsingBare.verify(); - beanUsingRx.verify(); beanUsingBlockingMailer.verify(); beanUsingReactiveMailer.verify().toCompletableFuture().join(); beanUsingLegacyReactiveMailer.verify().toCompletableFuture().join(); @@ -91,28 +82,6 @@ void verify() { } } - @ApplicationScoped - static class BeanUsingAxleMailClient { - - @Inject - io.vertx.axle.ext.mail.MailClient client; - - void verify() { - Assertions.assertNotNull(client); - } - } - - @ApplicationScoped - static class BeanUsingRxClient { - - @Inject - io.vertx.reactivex.ext.mail.MailClient client; - - void verify() { - Assertions.assertNotNull(client); - } - } - @ApplicationScoped static class BeanUsingMutinyClient { diff --git a/extensions/mailer/runtime/pom.xml b/extensions/mailer/runtime/pom.xml index e2570c4a4c8cb..adfec922ecff5 100644 --- a/extensions/mailer/runtime/pom.xml +++ b/extensions/mailer/runtime/pom.xml @@ -31,10 +31,6 @@ io.smallrye.reactive smallrye-mutiny-vertx-mail-client - - io.smallrye.reactive - smallrye-axle-mail-client - org.subethamail subethasmtp diff --git a/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/MailClientProducer.java b/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/MailClientProducer.java index 355ae161296dd..12ea98154d397 100644 --- a/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/MailClientProducer.java +++ b/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/MailClientProducer.java @@ -41,26 +41,6 @@ public io.vertx.mutiny.ext.mail.MailClient mutinyClient() { return mutinyClient; } - @Singleton - @Produces - @Deprecated - public io.vertx.axle.ext.mail.MailClient axleMailClient() { - LOGGER.warn( - "`io.vertx.axle.ext.mail.MailClient` is deprecated and will be removed in a future version - it is " - + "recommended to switch to `io.vertx.mutiny.ext.mail.MailClient`"); - return io.vertx.axle.ext.mail.MailClient.newInstance(client); - } - - @Singleton - @Produces - @Deprecated - public io.vertx.reactivex.ext.mail.MailClient rxMailClient() { - LOGGER.warn( - "`io.vertx.reactivex.ext.mail.MailClient` is deprecated and will be removed in a future version - it is " - + "recommended to switch to `io.vertx.mutiny.ext.mail.MailClient`"); - return io.vertx.reactivex.ext.mail.MailClient.newInstance(client); - } - @PreDestroy public void stop() { client.close(); diff --git a/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/MailTest.java b/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/MailTest.java index 256e5f2274ae9..6a8226dc37074 100644 --- a/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/MailTest.java +++ b/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/MailTest.java @@ -10,12 +10,9 @@ import java.util.List; import java.util.Map; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import io.smallrye.mutiny.Multi; -import io.vertx.axle.core.Vertx; class MailTest { @@ -24,17 +21,6 @@ class MailTest { private static final String DESCRIPTION = "my lorem ipsum"; private static final String TO_ADDRESS = "quarkus@quarkus.io"; private static final String TEXT_PLAIN = "text/plain"; - private static Vertx vertx; - - @BeforeAll - static void init() { - vertx = Vertx.vertx(); - } - - @AfterAll - static void closing() { - vertx.close().toCompletableFuture().join(); - } @Test void testSimpleTextEmail() { diff --git a/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/runtime/MailerImplTest.java b/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/runtime/MailerImplTest.java index b5add2d0ad9d2..06bf4c4a37e2a 100644 --- a/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/runtime/MailerImplTest.java +++ b/extensions/mailer/runtime/src/test/java/io/quarkus/mailer/runtime/MailerImplTest.java @@ -25,7 +25,7 @@ import org.subethamail.wiser.WiserMessage; import io.quarkus.mailer.Mail; -import io.reactivex.Flowable; +import io.smallrye.mutiny.Multi; import io.vertx.ext.mail.MailConfig; import io.vertx.mutiny.core.Vertx; import io.vertx.mutiny.ext.mail.MailClient; @@ -229,7 +229,7 @@ public Byte next() { }; mailer.send(Mail.withText(TO, "Test", "testAttachmentAsStream") - .addAttachment("my-file.txt", Flowable.fromIterable(iterable), TEXT_CONTENT_TYPE)) + .addAttachment("my-file.txt", Multi.createFrom().iterable(iterable), TEXT_CONTENT_TYPE)) .await().indefinitely(); assertThat(wiser.getMessages()).hasSize(1); WiserMessage actual = wiser.getMessages().get(0); @@ -260,7 +260,7 @@ public Byte next() { }; legacyMailer.send(Mail.withText(TO, "Test", "testAttachmentAsStream") - .addAttachment("my-file.txt", Flowable.fromIterable(iterable), TEXT_CONTENT_TYPE)) + .addAttachment("my-file.txt", Multi.createFrom().iterable(iterable), TEXT_CONTENT_TYPE)) .toCompletableFuture().join(); assertThat(wiser.getMessages()).hasSize(1); WiserMessage actual = wiser.getMessages().get(0); diff --git a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/ChannelConsumer.java b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/ChannelConsumer.java index 8de44a2aa72dc..f381e597bc495 100644 --- a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/ChannelConsumer.java +++ b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/ChannelConsumer.java @@ -11,20 +11,20 @@ import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder; import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams; -import io.reactivex.Flowable; +import io.smallrye.mutiny.Multi; @ApplicationScoped public class ChannelConsumer { @Inject @Channel("source-channel") - Flowable> sourceStream; + Multi> sourceStream; public List consume() { - return Flowable.fromPublisher(sourceStream) - .map(Message::getPayload) - .toList() - .blockingGet(); + return sourceStream + .onItem().transform(Message::getPayload) + .collect().asList() + .await().indefinitely(); } @Outgoing("source-channel") diff --git a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/DeprecatedChannelConsumer.java b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/DeprecatedChannelConsumer.java index ced1f95f5822d..c0280c56bfbd4 100644 --- a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/DeprecatedChannelConsumer.java +++ b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/channels/DeprecatedChannelConsumer.java @@ -9,8 +9,9 @@ import org.eclipse.microprofile.reactive.messaging.Outgoing; import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder; import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams; +import org.reactivestreams.Publisher; -import io.reactivex.Flowable; +import io.smallrye.mutiny.Multi; import io.smallrye.reactive.messaging.annotations.Channel; @ApplicationScoped @@ -18,13 +19,13 @@ public class DeprecatedChannelConsumer { @Inject @Channel("source-channel") - Flowable> sourceStream; + Publisher> sourceStream; public List consume() { - return Flowable.fromPublisher(sourceStream) - .map(Message::getPayload) - .toList() - .blockingGet(); + return Multi.createFrom().publisher(sourceStream) + .onItem().transform(Message::getPayload) + .collect().asList() + .await().indefinitely(); } @Outgoing("source-channel") diff --git a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/hotreload/SomeSource.java b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/hotreload/SomeSource.java index cfb07a6a4376e..cddf04eddf867 100644 --- a/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/hotreload/SomeSource.java +++ b/extensions/smallrye-reactive-messaging/deployment/src/test/java/io/quarkus/smallrye/reactivemessaging/hotreload/SomeSource.java @@ -1,18 +1,25 @@ package io.quarkus.smallrye.reactivemessaging.hotreload; +import java.util.function.Function; + import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.reactive.messaging.Outgoing; -import io.reactivex.Flowable; +import io.smallrye.mutiny.Multi; @ApplicationScoped public class SomeSource { @Outgoing("my-source") - public Flowable source() { - return Flowable.just(0, 1, 2, 3, 4, 5, 6, 7, 8) - .map(l -> l + 1); + public Multi source() { + return Multi.createFrom().items(0, 1, 2, 3, 4, 5, 6, 7, 8) + .map(new Function() { + @Override + public Integer apply(Integer l) { + return l + 1; + } + }); } } diff --git a/extensions/smallrye-reactive-messaging/runtime/pom.xml b/extensions/smallrye-reactive-messaging/runtime/pom.xml index 3e89fb0471159..b6a3082d21630 100644 --- a/extensions/smallrye-reactive-messaging/runtime/pom.xml +++ b/extensions/smallrye-reactive-messaging/runtime/pom.xml @@ -20,10 +20,6 @@ io.quarkus quarkus-mutiny-reactive-streams-operators - - io.reactivex.rxjava2 - rxjava - io.quarkus quarkus-vertx diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/DotNames.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/DotNames.java index f0a6a9436b23e..a46028c85546d 100644 --- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/DotNames.java +++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/DotNames.java @@ -26,17 +26,14 @@ final class DotNames { static final DotName UNI = DotName.createSimple(Uni.class.getName()); static final DotName MULTI = DotName.createSimple(Multi.class.getName()); static final DotName BUFFER = DotName.createSimple(Buffer.class.getName()); - static final DotName RX_BUFFER = DotName.createSimple(io.vertx.reactivex.core.buffer.Buffer.class.getName()); static final DotName MUTINY_BUFFER = DotName.createSimple(io.vertx.mutiny.core.buffer.Buffer.class.getName()); - static final DotName RX_HTTP_SERVER_RESPONSE = DotName - .createSimple(io.vertx.reactivex.core.http.HttpServerResponse.class.getName()); - static final DotName RX_HTTP_SERVER_REQUEST = DotName - .createSimple(io.vertx.reactivex.core.http.HttpServerRequest.class.getName()); static final DotName HTTP_SERVER_RESPONSE = DotName.createSimple(HttpServerResponse.class.getName()); static final DotName HTTP_SERVER_REQUEST = DotName.createSimple(HttpServerRequest.class.getName()); + static final DotName MUTINY_HTTP_SERVER_RESPONSE = DotName.createSimple( + io.vertx.mutiny.core.http.HttpServerResponse.class.getName()); + static final DotName MUTINY_HTTP_SERVER_REQUEST = DotName.createSimple( + io.vertx.mutiny.core.http.HttpServerRequest.class.getName()); static final DotName ROUTING_EXCHANGE = DotName.createSimple(RoutingExchange.class.getName()); - static final DotName RX_ROUTING_CONTEXT = DotName - .createSimple(io.vertx.reactivex.ext.web.RoutingContext.class.getName()); static final DotName ROUTING_CONTEXT = DotName.createSimple(RoutingContext.class.getName()); static final DotName BODY = DotName.createSimple(Body.class.getName()); static final DotName HEADER = DotName.createSimple(Header.class.getName()); diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/HandlerDescriptor.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/HandlerDescriptor.java index e1e3f6877dbcd..492ccaac49f33 100644 --- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/HandlerDescriptor.java +++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/HandlerDescriptor.java @@ -98,14 +98,6 @@ boolean isContentTypeBuffer() { return type.name().equals(DotNames.BUFFER); } - boolean isContentTypeRxBuffer() { - Type type = getContentType(); - if (type == null) { - return false; - } - return type.name().equals(DotNames.RX_BUFFER); - } - boolean isContentTypeMutinyBuffer() { Type type = getContentType(); if (type == null) { diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/Methods.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/Methods.java index 425efffb2cf97..0f436ac10466b 100644 --- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/Methods.java +++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/Methods.java @@ -93,8 +93,6 @@ class Methods { Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_SUBSCRIBE_BUFFER = MethodDescriptor.ofMethod(MultiSupport.class, "subscribeBuffer", Void.TYPE, Multi.class, RoutingContext.class); - static final MethodDescriptor MULTI_SUBSCRIBE_RX_BUFFER = MethodDescriptor.ofMethod(MultiSupport.class, "subscribeRxBuffer", - Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_SUBSCRIBE_MUTINY_BUFFER = MethodDescriptor.ofMethod(MultiSupport.class, "subscribeMutinyBuffer", Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_SUBSCRIBE_OBJECT = MethodDescriptor.ofMethod(MultiSupport.class, "subscribeObject", @@ -107,9 +105,6 @@ class Methods { static final MethodDescriptor MULTI_SSE_SUBSCRIBE_BUFFER = MethodDescriptor.ofMethod(MultiSseSupport.class, "subscribeBuffer", Void.TYPE, Multi.class, RoutingContext.class); - static final MethodDescriptor MULTI_SSE_SUBSCRIBE_RX_BUFFER = MethodDescriptor.ofMethod(MultiSseSupport.class, - "subscribeRxBuffer", - Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_SSE_SUBSCRIBE_MUTINY_BUFFER = MethodDescriptor.ofMethod(MultiSseSupport.class, "subscribeMutinyBuffer", Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_SSE_SUBSCRIBE_OBJECT = MethodDescriptor.ofMethod(MultiSseSupport.class, @@ -124,8 +119,6 @@ class Methods { "subscribeString", Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_JSON_SUBSCRIBE_BUFFER = MethodDescriptor.ofMethod(MultiJsonArraySupport.class, "subscribeBuffer", Void.TYPE, Multi.class, RoutingContext.class); - static final MethodDescriptor MULTI_JSON_SUBSCRIBE_RX_BUFFER = MethodDescriptor.ofMethod(MultiJsonArraySupport.class, - "subscribeRxBuffer", Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_JSON_SUBSCRIBE_MUTINY_BUFFER = MethodDescriptor.ofMethod(MultiJsonArraySupport.class, "subscribeMutinyBuffer", Void.TYPE, Multi.class, RoutingContext.class); static final MethodDescriptor MULTI_JSON_SUBSCRIBE_OBJECT = MethodDescriptor.ofMethod(MultiJsonArraySupport.class, @@ -140,9 +133,6 @@ class Methods { .ofMethod(HttpServerResponse.class, "end", Void.TYPE, Buffer.class); static final MethodDescriptor SET_STATUS = MethodDescriptor .ofMethod(HttpServerResponse.class, "setStatusCode", HttpServerResponse.class, Integer.TYPE); - static final MethodDescriptor RX_GET_DELEGATE = MethodDescriptor - .ofMethod(io.vertx.reactivex.core.buffer.Buffer.class, "getDelegate", Buffer.class); - static final MethodDescriptor MUTINY_GET_DELEGATE = MethodDescriptor .ofMethod(io.vertx.mutiny.core.buffer.Buffer.class, "getDelegate", Buffer.class); static final MethodDescriptor JSON_ENCODE = MethodDescriptor @@ -242,8 +232,7 @@ static ResultHandle createNpeBecauseItemIfNull(BytecodeCreator writer) { } static MethodDescriptor getEndMethodForContentType(HandlerDescriptor descriptor) { - if (descriptor.isContentTypeBuffer() || descriptor.isContentTypeRxBuffer() || descriptor - .isContentTypeMutinyBuffer()) { + if (descriptor.isContentTypeBuffer() || descriptor.isContentTypeMutinyBuffer()) { return END_WITH_BUFFER; } return END_WITH_STRING; diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java index ae113db3643e7..a0d575e05399b 100644 --- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java +++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java @@ -814,7 +814,7 @@ private static boolean isThrowable(Type paramType, IndexView index) { private static final List TYPES_IGNORED_FOR_REFLECTION = Arrays .asList(io.quarkus.arc.processor.DotNames.STRING, - DotNames.BUFFER, DotNames.RX_BUFFER, DotNames.JSON_ARRAY, DotNames.JSON_OBJECT); + DotNames.BUFFER, DotNames.JSON_ARRAY, DotNames.JSON_OBJECT); private static void registerForReflection(Type contentType, BuildProducer reflectiveHierarchy) { @@ -846,8 +846,6 @@ private void handleRegularMulti(HandlerDescriptor descriptor, BytecodeCreator wr writer.invokeStaticMethod(Methods.MULTI_SUBSCRIBE_BUFFER, res, rc); } else if (descriptor.isContentTypeMutinyBuffer()) { writer.invokeStaticMethod(Methods.MULTI_SUBSCRIBE_MUTINY_BUFFER, res, rc); - } else if (descriptor.isContentTypeRxBuffer()) { - writer.invokeStaticMethod(Methods.MULTI_SUBSCRIBE_RX_BUFFER, res, rc); } else if (descriptor.isContentTypeString()) { writer.invokeStaticMethod(Methods.MULTI_SUBSCRIBE_STRING, res, rc); } else { // Multi - encode to json. @@ -872,8 +870,6 @@ private void handleSSEMulti(HandlerDescriptor descriptor, BytecodeCreator writer writer.invokeStaticMethod(Methods.MULTI_SSE_SUBSCRIBE_BUFFER, res, rc); } else if (descriptor.isContentTypeMutinyBuffer()) { writer.invokeStaticMethod(Methods.MULTI_SSE_SUBSCRIBE_MUTINY_BUFFER, res, rc); - } else if (descriptor.isContentTypeRxBuffer()) { - writer.invokeStaticMethod(Methods.MULTI_SSE_SUBSCRIBE_RX_BUFFER, res, rc); } else if (descriptor.isContentTypeString()) { writer.invokeStaticMethod(Methods.MULTI_SSE_SUBSCRIBE_STRING, res, rc); } else { // Multi - encode to json. @@ -897,8 +893,7 @@ private void handleJsonArrayMulti(HandlerDescriptor descriptor, BytecodeCreator writer.invokeStaticMethod(Methods.MULTI_JSON_SUBSCRIBE_VOID, res, rc); } else if (descriptor.isContentTypeString()) { writer.invokeStaticMethod(Methods.MULTI_JSON_SUBSCRIBE_STRING, res, rc); - } else if (descriptor.isContentTypeBuffer() || descriptor.isContentTypeRxBuffer() - || descriptor.isContentTypeMutinyBuffer()) { + } else if (descriptor.isContentTypeBuffer() || descriptor.isContentTypeMutinyBuffer()) { writer.invokeStaticMethod(Methods.MULTI_JSON_FAIL, rc); } else { // Multi - encode to json. writer.invokeStaticMethod(Methods.MULTI_JSON_SUBSCRIBE_OBJECT, res, rc); @@ -919,7 +914,7 @@ private void handleJsonArrayMulti(HandlerDescriptor descriptor, BytecodeCreator *
      *     item -> {
      *       if (item != null) {
-     *          Buffer buffer = getBuffer(item); // Manage RX and Mutiny buffer
+     *          Buffer buffer = getBuffer(item); // Manage Mutiny buffer
      *          rc.response().end(buffer);
      *       } else {
      *           rc.fail(new NullPointerException(...);
@@ -1000,10 +995,6 @@ private ResultHandle getContentToWrite(HandlerDescriptor descriptor, ResultHandl
             return res;
         }
 
-        if (descriptor.isContentTypeRxBuffer()) {
-            return writer.invokeVirtualMethod(Methods.RX_GET_DELEGATE, res);
-        }
-
         if (descriptor.isContentTypeMutinyBuffer()) {
             return writer.invokeVirtualMethod(Methods.MUTINY_GET_DELEGATE, res);
         }
@@ -1141,20 +1132,6 @@ public ResultHandle get(MethodInfo method, Type paramType, Set annotations,
-                            ResultHandle routingContext, MethodCreator invoke, int position,
-                            BuildProducer reflectiveHierarchy) {
-                        return invoke.newInstance(
-                                MethodDescriptor
-                                        .ofConstructor(io.vertx.reactivex.ext.web.RoutingContext.class,
-                                                RoutingContext.class),
-                                routingContext);
-                    }
-                }).build());
-
         injectors.add(ParameterInjector.builder().matchType(DotNames.ROUTING_EXCHANGE)
                 .resultHandleProvider(new ResultHandleProvider() {
                     @Override
@@ -1192,7 +1169,7 @@ public ResultHandle get(MethodInfo method, Type paramType, Set annotations,
@@ -1200,7 +1177,7 @@ public ResultHandle get(MethodInfo method, Type paramType, Set reflectiveHierarchy) {
                         return invoke.newInstance(
                                 MethodDescriptor
-                                        .ofConstructor(io.vertx.reactivex.core.http.HttpServerRequest.class,
+                                        .ofConstructor(io.vertx.mutiny.core.http.HttpServerRequest.class,
                                                 HttpServerRequest.class),
                                 invoke
                                         .invokeInterfaceMethod(Methods.REQUEST,
@@ -1209,7 +1186,7 @@ public ResultHandle get(MethodInfo method, Type paramType, Set reflectiveHierarchy) {
                                 return invoke.newInstance(
                                         MethodDescriptor
-                                                .ofConstructor(io.vertx.reactivex.core.http.HttpServerResponse.class,
+                                                .ofConstructor(io.vertx.mutiny.core.http.HttpServerResponse.class,
                                                         HttpServerResponse.class),
                                         invoke
                                                 .invokeInterfaceMethod(Methods.RESPONSE,
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/SimpleRouteTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/SimpleRouteTest.java
index a68bdad0854a3..75702fa5ffd16 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/SimpleRouteTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/SimpleRouteTest.java
@@ -43,7 +43,6 @@ public class SimpleRouteTest {
     public void testSimpleRoute() {
         when().get("/hello").then().statusCode(200).body(is("Hello world!"));
         when().get("/no-slash").then().statusCode(200).body(is("Hello world!"));
-        when().get("/rx-hello").then().statusCode(200).body(is("Hello world!"));
         when().get("/bzuk").then().statusCode(200).body(is("Hello world!"));
         when().get("/hello-event-bus?name=ping").then().statusCode(200).body(is("Hello PING!"));
         when().get("/foo?name=foo").then().statusCode(200).body(is("Hello foo!"));
@@ -99,12 +98,6 @@ void secIdentity(RoutingContext context) {
             context.response().setStatusCode(200).end(securityIdentity.getPrincipal().getName());
         }
 
-        @Route(path = "/rx-hello")
-        void rxHello(io.vertx.reactivex.ext.web.RoutingContext context) {
-            String name = context.request().getParam("name");
-            context.response().setStatusCode(200).end("Hello " + (name != null ? name : "world") + "!");
-        }
-
         @Route // path is derived from the method name
         void bzuk(RoutingExchange exchange) {
             exchange.ok("Hello " + exchange.getParam("name").orElse("world") + "!");
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/MultiRouteTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/MultiRouteTest.java
index 0ada706fdb6cd..551f395597c5c 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/MultiRouteTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/MultiRouteTest.java
@@ -41,7 +41,6 @@ public void testMultiRoute() {
         when().get("/buffers").then().statusCode(200).body(is("Buffer Buffer Buffer."));
         when().get("/buffers-and-fail").then().statusCode(200).body(containsString("Buffer"));
 
-        when().get("/rx-buffer").then().statusCode(200).body(is("BufferBuffer"));
         when().get("/mutiny-buffer").then().statusCode(200).body(is("BufferBuffer"));
 
         when().get("/void").then().statusCode(204).body(hasLength(0));
@@ -102,12 +101,6 @@ Multi buffersAndFail(RoutingContext context) {
 
         }
 
-        @Route(path = "rx-buffer")
-        Multi bufferRx(RoutingContext context) {
-            return Multi.createFrom().items(io.vertx.reactivex.core.buffer.Buffer.buffer("Buffer"),
-                    io.vertx.reactivex.core.buffer.Buffer.buffer("Buffer"));
-        }
-
         @Route(path = "mutiny-buffer")
         Multi bufferMutiny(RoutingContext context) {
             return Multi.createFrom().items(io.vertx.mutiny.core.buffer.Buffer.buffer("Buffer"),
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SSEMultiRouteTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SSEMultiRouteTest.java
index ffedf65a83c06..6c998dbf1a106 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SSEMultiRouteTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SSEMultiRouteTest.java
@@ -54,10 +54,6 @@ public void testSSEMultiRoute() {
                 .body(is("data: Buffer\nid: 0\n\ndata: Buffer\nid: 1\n\ndata: Buffer.\nid: 2\n\n"))
                 .header("content-type", is("text/event-stream"));
 
-        when().get("/rx-buffer").then().statusCode(200)
-                .body(is("data: Buffer\nid: 0\n\ndata: RX\nid: 1\n\n"))
-                .header("content-type", is("text/event-stream"));
-
         when().get("/mutiny-buffer").then().statusCode(200)
                 .body(is("data: Buffer\nid: 0\n\ndata: Mutiny\nid: 1\n\n"))
                 .header("content-type", is("text/event-stream"));
@@ -150,13 +146,6 @@ Multi buffers(RoutingContext context) {
                     .items(Buffer.buffer("Buffer"), Buffer.buffer("Buffer"), Buffer.buffer("Buffer.")));
         }
 
-        @Route(path = "rx-buffer")
-        Multi bufferRx(RoutingContext context) {
-            return ReactiveRoutes
-                    .asEventStream(Multi.createFrom().items(io.vertx.reactivex.core.buffer.Buffer.buffer("Buffer"),
-                            io.vertx.reactivex.core.buffer.Buffer.buffer("RX")));
-        }
-
         @Route(path = "mutiny-buffer")
         Multi bufferMutiny(RoutingContext context) {
             return ReactiveRoutes
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SyncRouteTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SyncRouteTest.java
index de9c6dae80c94..8cb553a645a2a 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SyncRouteTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/SyncRouteTest.java
@@ -44,9 +44,6 @@ public void testSynchronousRoute() {
         when().get("hello-buffer-sync").then().statusCode(200).body(is("Sync Buffer"))
                 .header("content-type", is(nullValue()));
 
-        when().get("hello-buffer-rx-sync").then().statusCode(200).body(is("Sync RX Buffer"))
-                .header("content-type", is(nullValue()));
-
         when().get("hello-buffer-mutiny-sync").then().statusCode(200).body(is("Sync Mutiny Buffer"))
                 .header("content-type", is(nullValue()));
 
@@ -92,11 +89,6 @@ Buffer helloBufferSync(RoutingContext context) {
             return Buffer.buffer("Sync Buffer");
         }
 
-        @Route(path = "hello-buffer-rx-sync")
-        io.vertx.reactivex.core.buffer.Buffer helloRxBufferSync() {
-            return io.vertx.reactivex.core.buffer.Buffer.buffer("Sync RX Buffer");
-        }
-
         @Route(path = "hello-buffer-mutiny-sync")
         io.vertx.mutiny.core.buffer.Buffer helloMutinyBufferSync(RoutingContext context) {
             return io.vertx.mutiny.core.buffer.Buffer.buffer("Sync Mutiny Buffer");
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/UniRouteTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/UniRouteTest.java
index 74ce304ff5c5f..87e52fb81b31b 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/UniRouteTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/mutiny/UniRouteTest.java
@@ -28,7 +28,6 @@ public void testUniRoute() {
         when().get("/hello").then().statusCode(200).body(is("Hello world!"));
         when().get("/hello-buffer").then().statusCode(200).body(is("Buffer"));
         when().get("/hello-on-pool").then().statusCode(200).body(is("Pool"));
-        when().get("/hello-rx-buffer").then().statusCode(200).body(is("RX Buffer"));
         when().get("/hello-mutiny-buffer").then().statusCode(200).body(is("Mutiny Buffer"));
 
         when().get("/person").then().statusCode(200)
@@ -61,11 +60,6 @@ Uni helloWithBuffer(RoutingContext context) {
             return Uni.createFrom().item(Buffer.buffer("Buffer"));
         }
 
-        @Route(path = "hello-rx-buffer")
-        Uni helloWithRxBuffer(RoutingContext context) {
-            return Uni.createFrom().item(io.vertx.reactivex.core.buffer.Buffer.buffer("RX Buffer"));
-        }
-
         @Route(path = "hello-mutiny-buffer")
         Uni helloWithMutinyBuffer(RoutingContext context) {
             return Uni.createFrom().item(io.vertx.mutiny.core.buffer.Buffer.buffer("Mutiny Buffer"));
diff --git a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/params/RouteMethodParametersTest.java b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/params/RouteMethodParametersTest.java
index f687ba695103d..21aec7fce7ef2 100644
--- a/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/params/RouteMethodParametersTest.java
+++ b/extensions/vertx-web/deployment/src/test/java/io/quarkus/vertx/web/params/RouteMethodParametersTest.java
@@ -37,10 +37,9 @@ public class RouteMethodParametersTest {
 
     @Test
     public void testRoutes() {
-        //RestAssured.filters(new RequestLoggingFilter(), new ResponseLoggingFilter());
         when().get("/hello").then().statusCode(200).body(is("Hello world!"));
         when().get("/hello-response").then().statusCode(200).body(is("Hello world!"));
-        when().get("/hello-rx-response").then().statusCode(200).body(is("Hello world!"));
+        when().get("/hello-mutiny-response").then().statusCode(200).body(is("Hello world!"));
         when().get("/hello-response-nonvoid?name=foo").then().statusCode(200).body(is("Hello foo!"));
         when().get("/hello-all").then().statusCode(200).body(is("ok"));
         when().get("/hello-params?name=foo&identifier=10").then().statusCode(200).body(is("Hello foo! Your id is 10"));
@@ -89,9 +88,9 @@ void hello2(HttpServerResponse response) {
             response.setStatusCode(200).end("Hello world!");
         }
 
-        @Route(path = "/hello-rx-response")
-        void hello3(io.vertx.reactivex.core.http.HttpServerResponse response) {
-            response.setStatusCode(200).end("Hello world!");
+        @Route(path = "/hello-mutiny-response")
+        void hello3(io.vertx.mutiny.core.http.HttpServerResponse response) {
+            response.setStatusCode(200).endAndForget("Hello world!");
         }
 
         @Route(path = "/hello-response-nonvoid")
@@ -100,11 +99,11 @@ String hello4(HttpServerRequest request) {
         }
 
         @Route(path = "/hello-all")
-        String hello5(io.vertx.reactivex.core.http.HttpServerResponse rxResponse, RoutingContext routingContext,
+        String hello5(io.vertx.mutiny.core.http.HttpServerResponse mutinyResp, RoutingContext routingContext,
                 RoutingExchange routingExchange, HttpServerRequest request, HttpServerResponse response,
-                io.vertx.reactivex.core.http.HttpServerRequest rxRequest) {
-            assertNotNull(rxRequest);
-            assertNotNull(rxResponse);
+                io.vertx.mutiny.core.http.HttpServerRequest mutinyReq) {
+            assertNotNull(mutinyReq);
+            assertNotNull(mutinyResp);
             assertNotNull(routingContext);
             assertNotNull(routingExchange);
             assertNotNull(request);
diff --git a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/Route.java b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/Route.java
index 316e97c7dc75a..fa8a329a5d6ea 100644
--- a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/Route.java
+++ b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/Route.java
@@ -19,12 +19,12 @@
  * The annotated method can accept arguments of the following types:
  * 
    *
  • {@code io.vertx.ext.web.RoutingContext}
  • - *
  • {@code io.vertx.reactivex.ext.web.RoutingContext}
  • + *
  • {@code io.vertx.mutiny.ext.web.RoutingContext}
  • *
  • {@code io.quarkus.vertx.web.RoutingExchange}
  • *
  • {@code io.vertx.core.http.HttpServerRequest}
  • *
  • {@code io.vertx.core.http.HttpServerResponse}
  • - *
  • {@code io.vertx.reactivex.core.http.HttpServerRequest}
  • - *
  • {@code io.vertx.reactivex.core.http.HttpServerResponse}
  • + *
  • {@code io.vertx.mutiny.core.http.HttpServerRequest}
  • + *
  • {@code io.vertx.mutiny.core.http.HttpServerResponse}
  • *
* Furthermore, it is possible to inject the request parameters into a method parameter annotated with * {@link io.quarkus.vertx.web.Param}: diff --git a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSseSupport.java b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSseSupport.java index d1f18782bec90..11962e9bdd75c 100644 --- a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSseSupport.java +++ b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSseSupport.java @@ -131,15 +131,6 @@ public Buffer apply(io.vertx.mutiny.core.buffer.Buffer b) { }), rc); } - public static void subscribeRxBuffer(Multi multi, RoutingContext rc) { - subscribeBuffer(multi.map(new Function() { - @Override - public Buffer apply(io.vertx.reactivex.core.buffer.Buffer b) { - return b.getDelegate(); - } - }), rc); - } - public static void subscribeObject(Multi multi, RoutingContext rc) { AtomicLong count = new AtomicLong(); write(multi.map(new Function() { diff --git a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSupport.java b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSupport.java index 91ec3db62ed0f..58634cd62469f 100644 --- a/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSupport.java +++ b/extensions/vertx-web/runtime/src/main/java/io/quarkus/vertx/web/runtime/MultiSupport.java @@ -102,15 +102,6 @@ public Buffer apply(io.vertx.mutiny.core.buffer.Buffer b) { }), rc); } - public static void subscribeRxBuffer(Multi multi, RoutingContext rc) { - subscribeBuffer(multi.map(new Function() { - @Override - public Buffer apply(io.vertx.reactivex.core.buffer.Buffer b) { - return b.getDelegate(); - } - }), rc); - } - public static void subscribeObject(Multi multi, RoutingContext rc) { subscribeBuffer(multi.map(new Function() { @Override diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java index 8d9549165e60a..cf884d3940cc8 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java @@ -1,12 +1,10 @@ package io.quarkus.vertx.deployment; -import static io.quarkus.vertx.deployment.VertxConstants.AXLE_MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.COMPLETION_STAGE; import static io.quarkus.vertx.deployment.VertxConstants.CONSUME_EVENT; import static io.quarkus.vertx.deployment.VertxConstants.LOCAL_EVENT_BUS_CODEC; import static io.quarkus.vertx.deployment.VertxConstants.MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.MUTINY_MESSAGE; -import static io.quarkus.vertx.deployment.VertxConstants.RX_MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.UNI; import java.util.Arrays; @@ -14,6 +12,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Consumer; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; @@ -96,7 +95,12 @@ public void registerCodecs( // Register codec classes for reflection. codecByTypes.values().stream().map(DotName::toString).distinct() - .forEach(name -> reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name))); + .forEach(new Consumer() { + @Override + public void accept(String name) { + reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name)); + } + }); } private static final List BUILT_IN_CODECS = Arrays.asList( @@ -119,9 +123,7 @@ public void registerCodecs( // Buffers classes Buffer.class.getName(), - io.vertx.mutiny.core.buffer.Buffer.class.getName(), - io.vertx.axle.core.buffer.Buffer.class.getName(), - io.vertx.reactivex.core.buffer.Buffer.class.getName()); + io.vertx.mutiny.core.buffer.Buffer.class.getName()); private static Type extractPayloadTypeFromReturn(MethodInfo method) { Type returnType = method.returnType(); @@ -180,8 +182,6 @@ private static boolean hasBuiltInCodec(Type type) { */ private static boolean isMessageClass(ParameterizedType type) { return type.name().equals(MESSAGE) - || type.name().equals(RX_MESSAGE) - || type.name().equals(AXLE_MESSAGE) || type.name().equals(MUTINY_MESSAGE); } } diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusConsumer.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusConsumer.java index 195a2581fc70e..65a4e3454db46 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusConsumer.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusConsumer.java @@ -1,10 +1,8 @@ package io.quarkus.vertx.deployment; -import static io.quarkus.vertx.deployment.VertxConstants.AXLE_MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.COMPLETION_STAGE; import static io.quarkus.vertx.deployment.VertxConstants.MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.MUTINY_MESSAGE; -import static io.quarkus.vertx.deployment.VertxConstants.RX_MESSAGE; import static io.quarkus.vertx.deployment.VertxConstants.UNI; import java.util.concurrent.CompletableFuture; @@ -16,7 +14,6 @@ import org.jboss.jandex.DotName; import org.jboss.jandex.MethodInfo; import org.jboss.jandex.Type; -import org.jboss.logging.Logger; import io.quarkus.arc.Arc; import io.quarkus.arc.ArcContainer; @@ -55,12 +52,6 @@ class EventBusConsumer { .ofMethod(ArcContainer.class, "instance", InstanceHandle.class, InjectableBean.class); - private static final MethodDescriptor RX_MESSAGE_NEW_INSTANCE = MethodDescriptor.ofMethod( - io.vertx.reactivex.core.eventbus.Message.class, - "newInstance", io.vertx.reactivex.core.eventbus.Message.class, Message.class); - private static final MethodDescriptor AXLE_MESSAGE_NEW_INSTANCE = MethodDescriptor.ofMethod( - io.vertx.axle.core.eventbus.Message.class, - "newInstance", io.vertx.axle.core.eventbus.Message.class, Message.class); private static final MethodDescriptor MUTINY_MESSAGE_NEW_INSTANCE = MethodDescriptor.ofMethod( io.vertx.mutiny.core.eventbus.Message.class, "newInstance", io.vertx.mutiny.core.eventbus.Message.class, Message.class); @@ -125,34 +116,6 @@ static String generateInvoker(BeanInfo bean, MethodInfo method, return generatedName.replace('/', '.'); } - /** - * This method generates the following code: - * {@code - * Logger.getLogger(EventBusConsumer.class.getName()).warn(...); - * } - * It prints a deprecation method if the method annotated with {@link io.quarkus.vertx.ConsumeEvent} uses a - * deprecated type. - * - * @param invoke the invoker - * @param method the method using the deprecated type - * @param deprecatedClass the deprecated type - */ - private static void logDeprecation(BytecodeCreator invoke, MethodInfo method, String deprecatedClass) { - String msg = String - .format("The `%s.%s` method is using the deprecated `%s` class. This class will be removed in a " - + "future version. It is recommended to switch to `%s`", - method.declaringClass().name(), method.name(), deprecatedClass, - io.vertx.mutiny.core.eventbus.Message.class.getName()); - ResultHandle loggerName = invoke.load(EventBusConsumer.class.getName()); - ResultHandle message = invoke.load(msg); - MethodDescriptor getLoggerMethod = MethodDescriptor - .ofMethod(Logger.class, "getLogger", Logger.class, String.class); - ResultHandle logger = invoke - .invokeStaticMethod(getLoggerMethod, loggerName); - MethodDescriptor warnMethod = MethodDescriptor.ofMethod(Logger.class, "warn", Void.TYPE, Object.class); - invoke.invokeVirtualMethod(warnMethod, logger, message); - } - private static void invoke(BeanInfo bean, MethodInfo method, ResultHandle messageHandle, BytecodeCreator invoke) { ResultHandle containerHandle = invoke.invokeStaticMethod(ARC_CONTAINER); ResultHandle beanHandle = invoke.invokeInterfaceMethod(ARC_CONTAINER_BEAN, containerHandle, @@ -169,22 +132,6 @@ private static void invoke(BeanInfo bean, MethodInfo method, ResultHandle messag MethodDescriptor .ofMethod(bean.getImplClazz().name().toString(), method.name(), void.class, Message.class), beanInstanceHandle, messageHandle); - } else if (paramType.name().equals(RX_MESSAGE)) { - // io.vertx.reactivex.core.eventbus.Message - logDeprecation(invoke, method, RX_MESSAGE.toString()); - ResultHandle rxMessageHandle = invoke.invokeStaticMethod(RX_MESSAGE_NEW_INSTANCE, messageHandle); - invoke.invokeVirtualMethod( - MethodDescriptor.ofMethod(bean.getImplClazz().name().toString(), method.name(), void.class, - io.vertx.reactivex.core.eventbus.Message.class), - beanInstanceHandle, rxMessageHandle); - } else if (paramType.name().equals(AXLE_MESSAGE)) { - // io.vertx.axle.core.eventbus.Message - logDeprecation(invoke, method, AXLE_MESSAGE.toString()); - ResultHandle axleMessageHandle = invoke.invokeStaticMethod(AXLE_MESSAGE_NEW_INSTANCE, messageHandle); - invoke.invokeVirtualMethod( - MethodDescriptor.ofMethod(bean.getImplClazz().name().toString(), method.name(), void.class, - io.vertx.axle.core.eventbus.Message.class), - beanInstanceHandle, axleMessageHandle); } else if (paramType.name().equals(MUTINY_MESSAGE)) { // io.vertx.mutiny.core.eventbus.Message ResultHandle mutinyMessageHandle = invoke.invokeStaticMethod(MUTINY_MESSAGE_NEW_INSTANCE, messageHandle); diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxConstants.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxConstants.java index fdfa3669b1bf1..b766009e4789a 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxConstants.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxConstants.java @@ -12,10 +12,6 @@ public class VertxConstants { static final DotName MESSAGE = DotName.createSimple(Message.class.getName()); - static final DotName RX_MESSAGE = DotName - .createSimple(io.vertx.reactivex.core.eventbus.Message.class.getName()); - static final DotName AXLE_MESSAGE = DotName - .createSimple(io.vertx.axle.core.eventbus.Message.class.getName()); static final DotName MUTINY_MESSAGE = DotName .createSimple(io.vertx.mutiny.core.eventbus.Message.class.getName()); static final DotName COMPLETION_STAGE = DotName.createSimple(CompletionStage.class.getName()); diff --git a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java index 093f8a2c3a57e..260db97a9147a 100644 --- a/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java +++ b/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/VertxProcessor.java @@ -135,12 +135,6 @@ AutoAddScopeBuildItem autoAddScope() { @BuildStep void registerVerticleClasses(CombinedIndexBuildItem indexBuildItem, BuildProducer reflectiveClass) { - // RX Verticles - for (ClassInfo ci : indexBuildItem.getIndex() - .getAllKnownSubclasses(DotName.createSimple(io.vertx.reactivex.core.AbstractVerticle.class.getName()))) { - reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, ci.toString())); - } - // Mutiny Verticles for (ClassInfo ci : indexBuildItem.getIndex() .getAllKnownSubclasses(DotName.createSimple(io.smallrye.mutiny.vertx.core.AbstractVerticle.class.getName()))) { diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecRegistrationTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecRegistrationTest.java deleted file mode 100644 index f1a71d02ad2d2..0000000000000 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecRegistrationTest.java +++ /dev/null @@ -1,256 +0,0 @@ -package io.quarkus.vertx; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.awaitility.Awaitility.await; - -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.stream.Collectors; - -import javax.inject.Inject; - -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.QuarkusUnitTest; -import io.vertx.axle.core.Vertx; -import io.vertx.axle.core.eventbus.Message; - -public class AxleCodecRegistrationTest { - - @RegisterExtension - static final QuarkusUnitTest config = new QuarkusUnitTest() - .setArchiveProducer(() -> ShrinkWrap - .create(JavaArchive.class).addClasses(EventBusConsumers.class)); - - @Inject - EventBusConsumers bean; - - @Inject - Vertx vertx; - - @Test - public void testReceptionOfString() { - String address = "address-1"; - vertx.eventBus().send(address, "a"); - vertx.eventBus().send(address, "b"); - vertx.eventBus().send(address, "c"); - await().until(() -> bean.getAddress1().size() == 3); - } - - @Test - public void testReceptionOfStringAndSendingNothing() { - String address = "address-2"; - vertx.eventBus().send(address, "a"); - vertx.eventBus().send(address, "b"); - vertx.eventBus().send(address, "c"); - await().until(() -> bean.getAddress2().size() == 3); - - List> messages = new CopyOnWriteArrayList<>(); - vertx.eventBus().request(address, "d").thenAccept(messages::add); - vertx.eventBus().request(address, "e").thenAccept(messages::add); - await().until(() -> messages.size() == 2); - assertThat(messages.get(0).body()).isNull(); - assertThat(messages.get(1).body()).isNull(); - } - - @Test - public void testWithPrimitiveTypes() { - String address = "address-3"; - List> messages = new CopyOnWriteArrayList<>(); - vertx.eventBus(). request(address, 1).thenAccept(messages::add); - vertx.eventBus(). request(address, 2).thenAccept(messages::add); - await().until(() -> messages.size() == 2); - assertThat(messages.get(0).body()).isBetween(1L, 4L); - assertThat(messages.get(1).body()).isBetween(1L, 4L); - } - - @Test - public void testWithPrimitiveTypesAndCompletionStage() { - String address = "address-4"; - List> messages = new CopyOnWriteArrayList<>(); - vertx.eventBus(). request(address, 1).thenAccept(messages::add); - vertx.eventBus(). request(address, 2).thenAccept(messages::add); - await().until(() -> messages.size() == 2); - assertThat(messages.get(0).body()).isBetween(1L, 4L); - assertThat(messages.get(1).body()).isBetween(1L, 4L); - } - - @Test - public void testCodecRegistrationBasedOnParameterType() { - String address = "address-5"; - vertx.eventBus().send(address, new CustomType1("foo")); - vertx.eventBus().send(address, new CustomType1("bar")); - vertx.eventBus().send(address, new CustomType1("baz")); - - await().until(() -> bean.getSink().size() == 3); - - Set set = bean.getSink().stream().map(x -> (CustomType1) x).map(CustomType1::getName) - .collect(Collectors.toSet()); - assertThat(set).contains("foo", "bar", "baz"); - - bean.getSink().clear(); - address = "address-6"; - vertx.eventBus().send(address, new CustomType1("foo-x")); - vertx.eventBus().send(address, new CustomType1("bar-x")); - vertx.eventBus().send(address, new CustomType1("baz-x")); - - await().until(() -> bean.getSink().size() == 3); - set = bean.getSink().stream().map(x -> (CustomType1) x).map(CustomType1::getName) - .collect(Collectors.toSet()); - assertThat(set).contains("foo-x", "bar-x", "baz-x"); - } - - @Test - public void testCodecRegistrationBasedOnReturnType() { - String address = "address-7"; - List list = new CopyOnWriteArrayList<>(); - vertx.eventBus(). request(address, "foo").thenApply(Message::body).thenAccept(list::add); - vertx.eventBus(). request(address, "bar").thenApply(Message::body).thenAccept(list::add); - vertx.eventBus(). request(address, "baz").thenApply(Message::body).thenAccept(list::add); - - await().until(() -> list.size() == 3); - - Set set = list.stream().map(CustomType3::getName).collect(Collectors.toSet()); - assertThat(set).contains("foo", "bar", "baz"); - - } - - @Test - public void testCodecRegistrationBasedOnReturnTypeWithCompletionStage() { - String address = "address-8"; - List list = new CopyOnWriteArrayList<>(); - vertx.eventBus(). request(address, "foo").thenApply(Message::body).thenAccept(list::add); - vertx.eventBus(). request(address, "bar").thenApply(Message::body).thenAccept(list::add); - vertx.eventBus(). request(address, "baz").thenApply(Message::body).thenAccept(list::add); - - await().until(() -> list.size() == 3); - - Set set = list.stream().map(CustomType4::getName).collect(Collectors.toSet()); - assertThat(set).contains("foo", "bar", "baz"); - - } - - @SuppressWarnings("unused") - static class EventBusConsumers { - - private List address1 = new CopyOnWriteArrayList<>(); - private List address2 = new CopyOnWriteArrayList<>(); - - public List getAddress1() { - return address1; - } - - public List getAddress2() { - return address2; - } - - @ConsumeEvent("address-1") - void listenAddress1(String message) { - address1.add(message); - } - - @ConsumeEvent("address-2") - CompletionStage listenAddress2(String message) { - address2.add(message); - return CompletableFuture.completedFuture(null); - } - - @ConsumeEvent("address-3") - long listenAddress3(int i) { - return (long) (i + 1); - } - - @ConsumeEvent("address-4") - CompletionStage listenAddress4(int i) { - return CompletableFuture.completedFuture((long) (i + 1)); - } - - List sink = new CopyOnWriteArrayList<>(); - - @ConsumeEvent("address-5") - void codecRegistrationBasedOnParam(CustomType1 ct) { - sink.add(ct); - } - - @ConsumeEvent("address-6") - void codecRegistrationBasedOnParam(Message ct) { - sink.add(ct.body()); - } - - @ConsumeEvent("address-7") - CustomType3 codecRegistrationBasedReturnType(String n) { - return new CustomType3(n); - } - - @ConsumeEvent("address-8") - CompletionStage codecRegistrationBasedReturnTypeAndCS(String n) { - return CompletableFuture.completedFuture(new CustomType4(n)); - } - - public List getSink() { - return sink; - } - - } - - static class CustomType1 { - private final String name; - - CustomType1(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - @Override - public String toString() { - return "CustomType1{" + - "name='" + name + '\'' + - '}'; - } - } - - static class CustomType2 { - private final String name; - - CustomType2(String name) { - this.name = name; - } - - public String getName() { - return name; - } - } - - static class CustomType3 { - private final String name; - - CustomType3(String name) { - this.name = name; - } - - public String getName() { - return name; - } - } - - static class CustomType4 { - private final String name; - - CustomType4(String name) { - this.name = name; - } - - public String getName() { - return name; - } - } -} diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecTest.java deleted file mode 100644 index b7d076639d810..0000000000000 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/AxleCodecTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package io.quarkus.vertx; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; - -import javax.inject.Inject; - -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.QuarkusUnitTest; -import io.vertx.axle.core.Vertx; -import io.vertx.axle.core.eventbus.Message; - -public class AxleCodecTest { - - @RegisterExtension - static final QuarkusUnitTest config = new QuarkusUnitTest() - .setArchiveProducer(() -> ShrinkWrap - .create(JavaArchive.class).addClasses(MyBean.class, MyNonLocalBean.class, - MyPetCodec.class, Person.class, Pet.class)); - - @Inject - MyBean bean; - - /** - * Bean setting the consumption to be non-local. - * So, the user must configure the codec explicitly. - */ - @Inject - MyNonLocalBean nonLocalBean; - - @Inject - Vertx vertx; - - @Test - public void testWithGenericCodec() { - Greeting hello = vertx.eventBus(). request("person", new Person("bob", "morane")) - .thenApply(Message::body) - .toCompletableFuture().join(); - assertThat(hello.getMessage()).isEqualTo("Hello bob morane"); - } - - @Test - public void testWithUserCodec() { - Greeting hello = vertx.eventBus(). request("pet", new Pet("neo", "rabbit")) - .thenApply(Message::body) - .toCompletableFuture().join(); - assertThat(hello.getMessage()).isEqualTo("Hello NEO"); - } - - @Test - public void testWithUserCodecNonLocal() { - Greeting hello = vertx.eventBus(). request("nl-pet", new Pet("neo", "rabbit")) - .thenApply(Message::body) - .toCompletableFuture().join(); - assertThat(hello.getMessage()).isEqualTo("Non Local Hello NEO"); - } - - static class Greeting { - private final String message; - - Greeting(String message) { - this.message = message; - } - - String getMessage() { - return message; - } - } - - static class MyBean { - @ConsumeEvent("person") - public CompletionStage hello(Person p) { - return CompletableFuture.completedFuture(new Greeting("Hello " + p.getFirstName() + " " + p.getLastName())); - } - - @ConsumeEvent(value = "pet", codec = MyPetCodec.class) - public CompletionStage hello(Pet p) { - return CompletableFuture.completedFuture(new Greeting("Hello " + p.getName())); - } - } - - static class MyNonLocalBean { - @ConsumeEvent(value = "nl-pet", codec = MyPetCodec.class, local = false) - public CompletionStage hello(Pet p) { - return CompletableFuture.completedFuture(new Greeting("Non Local Hello " + p.getName())); - } - } - -} diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/VertxInjectionTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/VertxInjectionTest.java index 7f99c4c3087d3..fb80a50822d90 100644 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/VertxInjectionTest.java +++ b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/VertxInjectionTest.java @@ -41,12 +41,6 @@ public static class MyBeanUsingVertx { @Inject Vertx vertx; - @Inject - io.vertx.axle.core.Vertx axle; - - @Inject - io.vertx.reactivex.core.Vertx rx; - @Inject io.vertx.mutiny.core.Vertx mutiny; @@ -58,8 +52,6 @@ public boolean verify() { public void init(@Observes StartupEvent ev) { Assertions.assertNotNull(vertx); - Assertions.assertNotNull(axle); - Assertions.assertNotNull(rx); Assertions.assertNotNull(mutiny); ok = true; } @@ -71,12 +63,6 @@ public static class MyBeanUsingEventBus { @Inject EventBus vertx; - @Inject - io.vertx.axle.core.eventbus.EventBus axle; - - @Inject - io.vertx.reactivex.core.eventbus.EventBus rx; - @Inject io.vertx.mutiny.core.eventbus.EventBus mutiny; @@ -88,8 +74,6 @@ public boolean verify() { public void init(@Observes StartupEvent ev) { Assertions.assertNotNull(vertx); - Assertions.assertNotNull(axle); - Assertions.assertNotNull(rx); Assertions.assertNotNull(mutiny); ok = true; } diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java index 3182380d96068..7106ff2f66c60 100644 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java +++ b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java @@ -164,24 +164,6 @@ public void testBlockingConsumer() throws InterruptedException { assertTrue(message.contains("hello::true")); } - @Test - public void testPublishRx() throws InterruptedException { - SimpleBean.MESSAGES.clear(); - SimpleBean.latch = new CountDownLatch(1); - eventBus.publish("pub-rx", "Hello"); - SimpleBean.latch.await(2, TimeUnit.SECONDS); - assertTrue(SimpleBean.MESSAGES.contains("HELLO")); - } - - @Test - public void testPublishAxle() throws InterruptedException { - SimpleBean.MESSAGES.clear(); - SimpleBean.latch = new CountDownLatch(1); - eventBus.publish("pub-axle", "Hello"); - SimpleBean.latch.await(2, TimeUnit.SECONDS); - assertTrue(SimpleBean.MESSAGES.contains("HELLO")); - } - @Test public void testPublishMutiny() throws InterruptedException { SimpleBean.MESSAGES.clear(); @@ -249,18 +231,6 @@ void consumeBlocking(String message) { latch.countDown(); } - @ConsumeEvent("pub-axle") - void consume(io.vertx.axle.core.eventbus.Message message) { - MESSAGES.add(message.body().toUpperCase()); - latch.countDown(); - } - - @ConsumeEvent("pub-rx") - void consume(io.vertx.reactivex.core.eventbus.Message message) { - MESSAGES.add(message.body().toUpperCase()); - latch.countDown(); - } - @ConsumeEvent("pub-mutiny") void consume(io.vertx.mutiny.core.eventbus.Message message) { MESSAGES.add(message.body().toUpperCase()); diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/VertxProducerTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/VertxProducerTest.java index f87d891deeef3..b870e649d42e7 100644 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/VertxProducerTest.java +++ b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/VertxProducerTest.java @@ -14,7 +14,6 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.vertx.axle.core.buffer.Buffer; import io.vertx.core.Vertx; public class VertxProducerTest { @@ -24,8 +23,6 @@ public class VertxProducerTest { .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addAsResource(new File("src/test/resources/lorem.txt"), "files/lorem.txt") .addClasses(BeanUsingBareVertx.class) - .addClasses(BeanUsingAxleVertx.class) - .addClasses(BeanUsingRXVertx.class) .addClasses(BeanUsingMutinyVertx.class)); @Inject @@ -34,17 +31,9 @@ public class VertxProducerTest { @Inject BeanUsingMutinyVertx beanUsingMutiny; - @Inject - BeanUsingAxleVertx beanUsingAxle; - - @Inject - BeanUsingRXVertx beanUsingRx; - @Test public void testVertxInjection() throws Exception { beanUsingVertx.verify(); - beanUsingAxle.verify(); - beanUsingRx.verify(); beanUsingMutiny.verify(); } @@ -68,36 +57,6 @@ public void verify() throws Exception { } - @ApplicationScoped - static class BeanUsingAxleVertx { - - @Inject - io.vertx.axle.core.Vertx vertx; - - public void verify() throws Exception { - CountDownLatch latch = new CountDownLatch(1); - CompletionStage stage = vertx.fileSystem().readFile("files/lorem.txt"); - stage.thenAccept(buffer -> latch.countDown()); - latch.await(5, TimeUnit.SECONDS); - } - - } - - @ApplicationScoped - static class BeanUsingRXVertx { - - @Inject - io.vertx.reactivex.core.Vertx vertx; - - public void verify() throws Exception { - CountDownLatch latch = new CountDownLatch(1); - vertx.fileSystem().rxReadFile("src/test/resources/lorem.txt") - .subscribe(buffer -> latch.countDown()); - latch.await(5, TimeUnit.SECONDS); - } - - } - @ApplicationScoped static class BeanUsingMutinyVertx { diff --git a/extensions/vertx/runtime/pom.xml b/extensions/vertx/runtime/pom.xml index 1b4254e9d65d7..8db0494009ebb 100644 --- a/extensions/vertx/runtime/pom.xml +++ b/extensions/vertx/runtime/pom.xml @@ -37,34 +37,6 @@ io.smallrye.common smallrye-common-annotation - - io.smallrye.reactive - smallrye-axle-generator - - - io.smallrye.reactive - smallrye-reactive-streams-operators - - - io.vertx - vertx-codegen - - - - - io.smallrye.reactive - smallrye-axle-core - - - io.smallrye.reactive - smallrye-reactive-streams-operators - - - - - io.vertx - vertx-rx-java2 - io.quarkus quarkus-mutiny diff --git a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/runtime/VertxProducer.java b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/runtime/VertxProducer.java index a5640bda6da8e..fecb75c286eec 100644 --- a/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/runtime/VertxProducer.java +++ b/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/runtime/VertxProducer.java @@ -19,13 +19,11 @@ import io.vertx.core.eventbus.EventBus; /** - * Expose the Vert.x event bus and produces Mutiny, Axle (Deprecated) and Rx Vert.x (Deprecated) instances. + * Expose the Vert.x event bus and produces Mutiny instances. *

* The original Vert.x instance is coming from the core artifact. * - * IMPORTANT: The Axle and RxJava 2 API are now deprecated. It is recommended to switch to the Mutiny API. - * - * IMPL NOTE: There is no need to cache the mutiny/axle/rx wrappers locally because the bean instances are stored in the + * IMPL NOTE: There is no need to cache the mutiny locally because the bean instances are stored in the * singleton context, i.e. the producer method is only called once. */ @ApplicationScoped @@ -45,46 +43,6 @@ public io.vertx.mutiny.core.Vertx mutiny(Vertx vertx) { return io.vertx.mutiny.core.Vertx.newInstance(vertx); } - @Singleton - @Produces - @Deprecated - public io.vertx.axle.core.Vertx axle(Vertx vertx) { - LOGGER.warn( - "`io.vertx.axle.core.Vertx` is deprecated and will be removed in a future version - it is " - + "recommended to switch to `io.vertx.mutiny.core.Vertx`"); - return io.vertx.axle.core.Vertx.newInstance(vertx); - } - - @Singleton - @Produces - @Deprecated - public io.vertx.reactivex.core.Vertx rx(Vertx vertx) { - LOGGER.warn( - "`io.vertx.reactivex.core.Vertx` is deprecated and will be removed in a future version - it is " - + "recommended to switch to `io.vertx.mutiny.core.Vertx`"); - return io.vertx.reactivex.core.Vertx.newInstance(vertx); - } - - @Singleton - @Produces - @Deprecated - public io.vertx.axle.core.eventbus.EventBus axleEventBus(io.vertx.axle.core.Vertx axle) { - LOGGER.warn( - "`io.vertx.axle.core.eventbus.EventBus` is deprecated and will be removed in a future version - it is " - + "recommended to switch to `io.vertx.mutiny.core.eventbus.EventBus`"); - return axle.eventBus(); - } - - @Singleton - @Produces - @Deprecated - public io.vertx.reactivex.core.eventbus.EventBus rxEventBus(io.vertx.reactivex.core.Vertx rx) { - LOGGER.warn( - "`io.vertx.reactivex.core.eventbus.EventBus` is deprecated and will be removed in a future version - it " - + "is recommended to switch to `io.vertx.mutiny.core.eventbus.EventBus`"); - return rx.eventBus(); - } - @Singleton @Produces public io.vertx.mutiny.core.eventbus.EventBus mutinyEventBus(io.vertx.mutiny.core.Vertx mutiny) { diff --git a/extensions/vertx/runtime/src/test/java/io/quarkus/vertx/runtime/VertxProducerTest.java b/extensions/vertx/runtime/src/test/java/io/quarkus/vertx/runtime/VertxProducerTest.java index 1868eb04ee4f2..5d0bc6b9de611 100644 --- a/extensions/vertx/runtime/src/test/java/io/quarkus/vertx/runtime/VertxProducerTest.java +++ b/extensions/vertx/runtime/src/test/java/io/quarkus/vertx/runtime/VertxProducerTest.java @@ -34,14 +34,6 @@ public void shouldNotFailWithoutConfig() { private void verifyProducer(Vertx v) { assertThat(producer.eventbus(v)).isNotNull(); - assertThat(producer.axle(v)).isNotNull(); - assertFalse(producer.axle(v).isClustered()); - assertThat(producer.axleEventBus(producer.axle(v))).isNotNull(); - - assertThat(producer.rx(v)).isNotNull(); - assertFalse(producer.rx(v).isClustered()); - assertThat(producer.rxEventBus(producer.rx(v))).isNotNull(); - assertThat(producer.mutiny(v)).isNotNull(); assertFalse(producer.mutiny(v).isClustered()); assertThat(producer.mutinyEventBus(producer.mutiny(v))).isNotNull(); diff --git a/integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingVertx.java b/integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingVertx.java index eba76c7f191e8..5a62713303abc 100644 --- a/integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingVertx.java +++ b/integration-tests/amazon-lambda-http/src/main/java/io/quarkus/it/amazon/lambda/GreetingVertx.java @@ -21,19 +21,6 @@ void helloPost(RoutingContext context) { context.response().setStatusCode(200).end("hello " + name); } - @Route(path = "/vertx/rx/hello", methods = GET) - void rxHelloGet(io.vertx.reactivex.ext.web.RoutingContext context) { - context.response().headers().set("Content-Type", "text/plain"); - context.response().setStatusCode(200).end("hello"); - } - - @Route(path = "/vertx/rx/hello", methods = POST) - void rxHelloPost(io.vertx.reactivex.ext.web.RoutingContext context) { - String name = context.getBodyAsString(); - context.response().headers().set("Content-Type", "text/plain"); - context.response().setStatusCode(200).end("hello " + name); - } - @Route(path = "/vertx/exchange/hello", methods = GET) void exchange(RoutingExchange exchange) { exchange.response().headers().set("Content-Type", "text/plain"); diff --git a/integration-tests/main/src/main/java/io/quarkus/it/reactive/ReactiveStreamOpsResource.java b/integration-tests/main/src/main/java/io/quarkus/it/reactive/ReactiveStreamOpsResource.java index 4a52774b70f77..756847cd0c517 100644 --- a/integration-tests/main/src/main/java/io/quarkus/it/reactive/ReactiveStreamOpsResource.java +++ b/integration-tests/main/src/main/java/io/quarkus/it/reactive/ReactiveStreamOpsResource.java @@ -5,7 +5,7 @@ import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams; -import io.reactivex.Flowable; +import io.smallrye.mutiny.Multi; @Path("/reactive") public class ReactiveStreamOpsResource { @@ -27,10 +27,10 @@ public String stream1() { } @GET - @Path("/stream-rx") + @Path("/stream-mutiny") public String stream2() { StringBuilder builder = new StringBuilder(); - ReactiveStreams.fromPublisher(Flowable.fromArray("d", "e", "f")) + ReactiveStreams.fromPublisher(Multi.createFrom().items("d", "e", "f")) .map(String::toUpperCase) .forEach(builder::append) .run(); diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/ReactiveStreamsOperatorsTestCase.java b/integration-tests/main/src/test/java/io/quarkus/it/main/ReactiveStreamsOperatorsTestCase.java index d3b5b5791f461..ca9f1c1dae491 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/ReactiveStreamsOperatorsTestCase.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/ReactiveStreamsOperatorsTestCase.java @@ -17,8 +17,8 @@ public void testReactiveStreams() { } @Test - public void testRxJava2() { - RestAssured.when().get("/reactive/stream-rx").then() + public void testMutiny() { + RestAssured.when().get("/reactive/stream-mutiny").then() .body(is("DEF")); } diff --git a/integration-tests/vertx/pom.xml b/integration-tests/vertx/pom.xml index bb9c97ec9fcdd..2d852f2b6efbd 100644 --- a/integration-tests/vertx/pom.xml +++ b/integration-tests/vertx/pom.xml @@ -18,6 +18,10 @@ io.quarkus quarkus-resteasy + + io.quarkus + quarkus-resteasy-mutiny + io.quarkus quarkus-arc @@ -70,6 +74,19 @@ + + io.quarkus + quarkus-resteasy-mutiny-deployment + ${project.version} + pom + test + + + * + * + + + io.quarkus quarkus-vertx-deployment diff --git a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/EventBusSender.java b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/EventBusSender.java index 9cc4d807087f1..d623a40c3bfb2 100644 --- a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/EventBusSender.java +++ b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/EventBusSender.java @@ -1,14 +1,13 @@ package io.quarkus.it.vertx; -import java.util.concurrent.CompletionStage; - import javax.inject.Inject; import javax.ws.rs.POST; import javax.ws.rs.Path; -import io.vertx.axle.core.eventbus.EventBus; -import io.vertx.axle.core.eventbus.Message; +import io.smallrye.mutiny.Uni; import io.vertx.core.json.JsonObject; +import io.vertx.mutiny.core.eventbus.EventBus; +import io.vertx.mutiny.core.eventbus.Message; @Path("/event-bus") public class EventBusSender { @@ -18,15 +17,16 @@ public class EventBusSender { @POST @Path("/person") - public CompletionStage helloToPerson(JsonObject json) { - return bus. request("persons", json.getString("name")).thenApply(Message::body); + public Uni helloToPerson(JsonObject json) { + return bus. request("persons", json.getString("name")) + .onItem().transform(Message::body); } @POST @Path("/pet") - public CompletionStage helloToPet(JsonObject json) { + public Uni helloToPet(JsonObject json) { return bus. request("pets", new Pet(json.getString("name"), json.getString("kind"))) - .thenApply(Message::body); + .onItem().transform(Message::body); } } diff --git a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/VertxProducerResource.java b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/VertxProducerResource.java index bb68b2af79b50..1e832d758932c 100644 --- a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/VertxProducerResource.java +++ b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/VertxProducerResource.java @@ -3,7 +3,6 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import java.util.concurrent.CompletionStage; import javax.inject.Inject; import javax.ws.rs.GET; @@ -11,10 +10,11 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import io.vertx.axle.core.Vertx; -import io.vertx.axle.core.eventbus.EventBus; -import io.vertx.axle.core.eventbus.Message; -import io.vertx.axle.core.eventbus.MessageConsumer; +import io.smallrye.mutiny.Uni; +import io.vertx.mutiny.core.Vertx; +import io.vertx.mutiny.core.eventbus.EventBus; +import io.vertx.mutiny.core.eventbus.Message; +import io.vertx.mutiny.core.eventbus.MessageConsumer; @Path("/") public class VertxProducerResource { @@ -37,18 +37,19 @@ public Map test() { @GET @Produces(MediaType.TEXT_PLAIN) @Path("/eventBus") - public CompletionStage eb() { + public Uni eb() { String address = UUID.randomUUID().toString(); // Use the event bus bean. MessageConsumer consumer = eventBus.consumer(address); consumer.handler(m -> { - m.reply("hello " + m.body()); + m.replyAndForget("hello " + m.body()); consumer.unregister(); }); // Use the Vert.x bean. - return vertx.eventBus(). request(address, "quarkus").thenApply(Message::body); + return vertx.eventBus(). request(address, "quarkus") + .onItem().transform(Message::body); } } diff --git a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/RxVerticle.java b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/RxVerticle.java deleted file mode 100644 index bd742b50ec6ce..0000000000000 --- a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/RxVerticle.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.quarkus.it.vertx.verticles; - -import io.reactivex.Completable; -import io.vertx.reactivex.core.AbstractVerticle; - -public class RxVerticle extends AbstractVerticle { - - @Override - public Completable rxStart() { - String address = config().getString("id"); - return vertx.eventBus().consumer(address) - .handler(message -> message.reply("OK-" + address)) - .rxCompletionHandler(); - } - -} diff --git a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleDeployer.java b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleDeployer.java index a7cdf335a6993..96f1c88834865 100644 --- a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleDeployer.java +++ b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleDeployer.java @@ -7,9 +7,9 @@ import javax.inject.Inject; import io.quarkus.runtime.StartupEvent; -import io.vertx.axle.core.Vertx; import io.vertx.core.DeploymentOptions; import io.vertx.core.json.JsonObject; +import io.vertx.mutiny.core.Vertx; @ApplicationScoped public class VerticleDeployer { @@ -21,27 +21,19 @@ public void init(@Observes StartupEvent ev) { CountDownLatch latch = new CountDownLatch(5); vertx.deployVerticle(BareVerticle::new, new DeploymentOptions().setConfig(new JsonObject() .put("id", "bare"))) - .thenAccept(x -> latch.countDown()); + .subscribe().with(x -> latch.countDown()); vertx.deployVerticle(BareVerticle.class.getName(), new DeploymentOptions().setConfig(new JsonObject() .put("id", "bare-classname"))) - .thenAccept(x -> latch.countDown()); - - vertx.deployVerticle(RxVerticle::new, new DeploymentOptions().setConfig(new JsonObject() - .put("id", "rx"))) - .thenAccept(x -> latch.countDown()); - - vertx.deployVerticle(RxVerticle.class.getName(), new DeploymentOptions().setConfig(new JsonObject() - .put("id", "rx-classname"))) - .thenAccept(x -> latch.countDown()); + .subscribe().with(x -> latch.countDown()); vertx.deployVerticle(MutinyAsyncVerticle::new, new DeploymentOptions().setConfig(new JsonObject() .put("id", "mutiny"))) - .thenAccept(x -> latch.countDown()); + .subscribe().with(x -> latch.countDown()); vertx.deployVerticle(MutinyAsyncVerticle.class.getName(), new DeploymentOptions().setConfig(new JsonObject() .put("id", "mutiny-classname"))) - .thenAccept(x -> latch.countDown()); + .subscribe().with(x -> latch.countDown()); latch.countDown(); } diff --git a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleEndpoint.java b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleEndpoint.java index 54b6b107cc6ac..7ff129de0e773 100644 --- a/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleEndpoint.java +++ b/integration-tests/vertx/src/main/java/io/quarkus/it/vertx/verticles/VerticleEndpoint.java @@ -1,15 +1,14 @@ package io.quarkus.it.vertx.verticles; -import java.util.concurrent.CompletionStage; - 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 io.vertx.axle.core.Vertx; -import io.vertx.axle.core.eventbus.Message; +import io.smallrye.mutiny.Uni; +import io.vertx.mutiny.core.Vertx; +import io.vertx.mutiny.core.eventbus.Message; @Path("/verticles") @Produces(MediaType.TEXT_PLAIN) @@ -20,44 +19,30 @@ public class VerticleEndpoint { @GET @Path("/bare") - public CompletionStage bare() { + public Uni bare() { return vertx.eventBus(). request("bare", "") - .thenApply(Message::body); + .onItem().transform(Message::body); } @GET @Path("/bare-classname") - public CompletionStage bareWithClassName() { + public Uni bareWithClassName() { return vertx.eventBus(). request("bare-classname", "") - .thenApply(Message::body); - } - - @GET - @Path("/rx") - public CompletionStage rx() { - return vertx.eventBus(). request("rx", "") - .thenApply(Message::body); - } - - @GET - @Path("/rx-classname") - public CompletionStage rxWithClassName() { - return vertx.eventBus(). request("rx-classname", "") - .thenApply(Message::body); + .onItem().transform(Message::body); } @GET @Path("/mutiny") - public CompletionStage mutiny() { + public Uni mutiny() { return vertx.eventBus(). request("mutiny", "") - .thenApply(Message::body); + .onItem().transform(Message::body); } @GET @Path("/mutiny-classname") - public CompletionStage mutinyWithClassName() { + public Uni mutinyWithClassName() { return vertx.eventBus(). request("mutiny-classname", "") - .thenApply(Message::body); + .onItem().transform(Message::body); } } diff --git a/integration-tests/vertx/src/test/java/io/quarkus/it/vertx/VerticleTest.java b/integration-tests/vertx/src/test/java/io/quarkus/it/vertx/VerticleTest.java index 9e750677f9c4f..ff67080ab94de 100644 --- a/integration-tests/vertx/src/test/java/io/quarkus/it/vertx/VerticleTest.java +++ b/integration-tests/vertx/src/test/java/io/quarkus/it/vertx/VerticleTest.java @@ -21,16 +21,4 @@ public void testBareWithClassNameVerticle() { String s = get("/vertx-test/verticles/bare-classname").asString(); assertThat(s).isEqualTo("OK-bare-classname"); } - - @Test - public void testRxVerticle() { - String s = get("/vertx-test/verticles/rx").asString(); - assertThat(s).isEqualTo("OK-rx"); - } - - @Test - public void testRxWithClassNameVerticle() { - String s = get("/vertx-test/verticles/rx-classname").asString(); - assertThat(s).isEqualTo("OK-rx-classname"); - } } diff --git a/integration-tests/virtual-http/src/main/java/io/quarkus/it/virtual/GreetingVertx.java b/integration-tests/virtual-http/src/main/java/io/quarkus/it/virtual/GreetingVertx.java index 1224a7da3884f..f8954694067a2 100644 --- a/integration-tests/virtual-http/src/main/java/io/quarkus/it/virtual/GreetingVertx.java +++ b/integration-tests/virtual-http/src/main/java/io/quarkus/it/virtual/GreetingVertx.java @@ -20,19 +20,6 @@ void helloPost(RoutingContext context) { context.response().setStatusCode(200).end("hello " + name); } - @Route(path = "/vertx/rx/hello", methods = GET) - void rxHelloGet(io.vertx.reactivex.ext.web.RoutingContext context) { - context.response().headers().set("Content-Type", "text/plain"); - context.response().setStatusCode(200).end("hello"); - } - - @Route(path = "/vertx/rx/hello", methods = POST) - void rxHelloPost(io.vertx.reactivex.ext.web.RoutingContext context) { - String name = context.getBodyAsString(); - context.response().headers().set("Content-Type", "text/plain"); - context.response().setStatusCode(200).end("hello " + name); - } - @Route(path = "/vertx/exchange/hello", methods = GET) void exchange(RoutingExchange exchange) { exchange.response().headers().set("Content-Type", "text/plain"); diff --git a/integration-tests/virtual-http/src/test/java/io/quarkus/it/virtual/FunctionTest.java b/integration-tests/virtual-http/src/test/java/io/quarkus/it/virtual/FunctionTest.java index 0d9062ebecd20..1db414ee51fac 100644 --- a/integration-tests/virtual-http/src/test/java/io/quarkus/it/virtual/FunctionTest.java +++ b/integration-tests/virtual-http/src/test/java/io/quarkus/it/virtual/FunctionTest.java @@ -80,9 +80,6 @@ public void testVertx() throws Exception { String uri = "https://foo.com/vertx/hello"; testGET(uri); testPOST(uri); - uri = "https://foo.com/vertx/rx/hello"; - testGET(uri); - testPOST(uri); uri = "https://foo.com/vertx/exchange/hello"; testGET(uri); }