Skip to content

Commit

Permalink
Merge pull request #24672 from geoand/#24671
Browse files Browse the repository at this point in the history
Allow control of resume on 404 behavior via build item
  • Loading branch information
geoand authored Mar 31, 2022
2 parents 6346b35 + 9c27c13 commit b010b61
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -146,6 +146,7 @@
import io.quarkus.resteasy.reactive.server.spi.ContextTypeBuildItem;
import io.quarkus.resteasy.reactive.server.spi.MethodScannerBuildItem;
import io.quarkus.resteasy.reactive.server.spi.NonBlockingReturnTypeBuildItem;
import io.quarkus.resteasy.reactive.server.spi.ResumeOn404BuildItem;
import io.quarkus.resteasy.reactive.spi.CustomExceptionMapperBuildItem;
import io.quarkus.resteasy.reactive.spi.DynamicFeatureBuildItem;
import io.quarkus.resteasy.reactive.spi.ExceptionMapperBuildItem;
@@ -696,7 +697,8 @@ public void setupDeployment(BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,
ParamConverterProvidersBuildItem paramConverterProvidersBuildItem,
ContextResolversBuildItem contextResolversBuildItem,
ResteasyReactiveServerConfig serverConfig,
LaunchModeBuildItem launchModeBuildItem)
LaunchModeBuildItem launchModeBuildItem,
List<ResumeOn404BuildItem> resumeOn404Items)
throws NoSuchMethodException {

if (!resourceScanningResultBuildItem.isPresent()) {
@@ -814,7 +816,7 @@ public void setupDeployment(BeanArchiveIndexBuildItem beanArchiveIndexBuildItem,
RuntimeValue<Deployment> deployment = recorder.createDeployment(deploymentInfo,
beanContainerBuildItem.getValue(), shutdownContext, vertxConfig,
requestContextFactoryBuildItem.map(RequestContextFactoryBuildItem::getFactory).orElse(null),
initClassFactory, launchModeBuildItem.getLaunchMode(), servletPresent);
initClassFactory, launchModeBuildItem.getLaunchMode(), servletPresent || !resumeOn404Items.isEmpty());

quarkusRestDeploymentBuildItemBuildProducer
.produce(new ResteasyReactiveDeploymentBuildItem(deployment, deploymentPath));
Original file line number Diff line number Diff line change
@@ -73,9 +73,9 @@ public RuntimeValue<Deployment> createDeployment(DeploymentInfo info,
ShutdownContext shutdownContext, HttpBuildTimeConfig vertxConfig,
RequestContextFactory contextFactory,
BeanFactory<ResteasyReactiveInitialiser> initClassFactory,
LaunchMode launchMode, boolean servletPresent) {
LaunchMode launchMode, boolean resumeOn404) {

if (servletPresent) {
if (resumeOn404) {
info.setResumeOn404(true);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.quarkus.resteasy.reactive.server.spi;

import io.quarkus.builder.item.MultiBuildItem;

/**
* A marker build item which extensions can generate when they want to force RESTEasy Reactive to not
* reply with 404 when it does not handle the path and instead just pass control onto the next
* Vert.x handler
*/
public final class ResumeOn404BuildItem extends MultiBuildItem {
}

0 comments on commit b010b61

Please sign in to comment.