Skip to content

Commit

Permalink
Allow Undertow to work with RESTEasy Reactive
Browse files Browse the repository at this point in the history
Note that this integration is different to the integration provided by
resteasy-reactive-servlet or the RESTEasy classic integration. This
allows RESTEasy Reactive to run before Servlet, and delegate any
unmatched requests to the Servlet container. If RESTEasy reactive
matches then Servlet is not involved in the request handling.
  • Loading branch information
stuartwdouglas committed Oct 20, 2021
1 parent a2c81ef commit c8188a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ public void setupDeployment(BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,

// Exact match for resources matched to the root path
routes.produce(RouteBuildItem.builder()
.orderedRoute(deploymentPath, VertxHttpRecorder.DEFAULT_ROUTE_ORDER + 1).handler(handler).build());
.orderedRoute(deploymentPath, VertxHttpRecorder.DEFAULT_ROUTE_ORDER - 1).handler(handler).build());
String matchPath = deploymentPath;
if (matchPath.endsWith("/")) {
matchPath += "*";
Expand All @@ -764,7 +764,7 @@ public void setupDeployment(BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,
}
// Match paths that begin with the deployment path
routes.produce(
RouteBuildItem.builder().orderedRoute(matchPath, VertxHttpRecorder.DEFAULT_ROUTE_ORDER + 1)
RouteBuildItem.builder().orderedRoute(matchPath, VertxHttpRecorder.DEFAULT_ROUTE_ORDER - 1)
.handler(handler).build());
}
}
Expand Down
23 changes: 22 additions & 1 deletion integration-tests/hibernate-reactive-panache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jsonb</artifactId>
</dependency>
<!--
Makes sure that undertow does not interfere with RESTEasy Reactive
Undertow is blocking so if it interfered it would break everything
but the RR endpoints should run first
-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
Expand Down Expand Up @@ -144,7 +153,19 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit c8188a4

Please sign in to comment.