Skip to content

Commit

Permalink
Merge pull request quarkusio#20465 from stuartwdouglas/grpc-remove-ve…
Browse files Browse the repository at this point in the history
…rtx-dep

Remove vertx-http dependency from gRPC
  • Loading branch information
geoand authored Sep 30, 2021
2 parents 8c69102 + e688d0b commit 210301e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
6 changes: 1 addition & 5 deletions extensions/grpc/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<name>Quarkus - gRPC - Deployment</name>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
Expand Down Expand Up @@ -56,7 +52,7 @@
<!-- for dev mode -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<artifactId>quarkus-vertx-http-dev-console-spi</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import io.quarkus.arc.deployment.GeneratedBeanBuildItem;
import io.quarkus.arc.deployment.GeneratedBeanGizmoAdaptor;
import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
import io.quarkus.arc.profile.IfBuildProfile;
import io.quarkus.arc.runtime.BeanLookupSupplier;
import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -44,6 +43,7 @@
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.dev.console.DevConsoleManager;
import io.quarkus.dev.testing.GrpcWebSocketProxy;
import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem;
import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem;
import io.quarkus.gizmo.ClassCreator;
import io.quarkus.gizmo.MethodCreator;
Expand All @@ -53,8 +53,6 @@
import io.quarkus.grpc.runtime.devmode.DelegatingGrpcBeansStorage;
import io.quarkus.grpc.runtime.devmode.GrpcDevConsoleRecorder;
import io.quarkus.grpc.runtime.devmode.GrpcServices;
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
import io.quarkus.vertx.http.deployment.RouteBuildItem;

public class GrpcDevConsoleProcessor {

Expand All @@ -67,8 +65,7 @@ public void devConsoleInfo(BuildProducer<AdditionalBeanBuildItem> beans,
new BeanLookupSupplier(GrpcServices.class)));
}

@IfBuildProfile("dev")
@BuildStep
@BuildStep(onlyIf = IsDevelopment.class)
void prepareDelegatingBeanStorage(
List<DelegatingGrpcBeanBuildItem> delegatingBeans,
BuildProducer<UnremovableBeanBuildItem> unremovableBeans,
Expand Down Expand Up @@ -133,11 +130,9 @@ public void collectMessagePrototypes(CombinedIndexBuildItem index,
@Consume(RuntimeConfigSetupCompleteBuildItem.class)
@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep(onlyIf = IsDevelopment.class)
public RouteBuildItem createWebSocketEndpoint(NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
GrpcDevConsoleRecorder recorder) {
public DevConsoleRouteBuildItem createWebSocketEndpoint(GrpcDevConsoleRecorder recorder) {
recorder.setServerConfiguration();
return nonApplicationRootPathBuildItem.routeBuilder().route("dev/grpc-test")
.handler(recorder.handler()).build();
return new DevConsoleRouteBuildItem("grpc-test", "GET", recorder.handler());
}

Collection<Class<?>> getGrpcServices(IndexView index) throws ClassNotFoundException {
Expand Down Expand Up @@ -167,4 +162,5 @@ Collection<Class<?>> getGrpcServices(IndexView index) throws ClassNotFoundExcept
serviceClasses.add(HealthGrpc.class);
return serviceClasses;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
wsUri = "ws:";
}

wsUri += "//" + window.location.host + "/q/dev/grpc-test";
wsUri += "//" + window.location.host + "/q/dev/io.quarkus.quarkus-grpc/grpc-test";
grpcWS = new WebSocket(wsUri);
grpcWS.onopen = function (event) {
console.log("websocket connected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void websocketTest() throws Exception {
List<String> incomingMessages = new CopyOnWriteArrayList<>();
HttpClient client = vertx.createHttpClient();

client.webSocket(8080, "localhost", "/q/dev/grpc-test", result -> {
client.webSocket(8080, "localhost", "/q/dev/io.quarkus.quarkus-grpc/grpc-test", result -> {
if (result.failed()) {
log.error("failure making a web socket connection", result.cause());
return;
Expand Down
4 changes: 2 additions & 2 deletions extensions/grpc/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<artifactId>quarkus-arc</artifactId>
</dependency>

<!-- for dev mode, TODO: try to get rid of it-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http</artifactId>
<artifactId>quarkus-vertx-http-dev-console-runtime-spi</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down

0 comments on commit 210301e

Please sign in to comment.