Skip to content

Commit

Permalink
Remove workaround for quarkusio/quarkus#4564 as it seems to be fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Nov 20, 2019
1 parent c39fbd9 commit 3d618af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@
*/
package org.apache.camel.quarkus.component.platform.http.deployment;

import java.util.ArrayList;
import java.util.List;
import java.util.Collections;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.vertx.http.deployment.VertxWebRouterBuildItem;
import io.quarkus.vertx.web.deployment.BodyHandlerBuildItem;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
import org.apache.camel.component.platform.http.PlatformHttpComponent;
import org.apache.camel.component.platform.http.PlatformHttpConstants;
import org.apache.camel.quarkus.component.platform.http.runtime.PlatformHttpHandlers;
import org.apache.camel.quarkus.component.platform.http.runtime.PlatformHttpRecorder;
import org.apache.camel.quarkus.component.platform.http.runtime.QuarkusPlatformHttpEngine;
import org.apache.camel.quarkus.core.CamelServiceFilter;
Expand Down Expand Up @@ -60,32 +56,17 @@ PlatformHttpEngineBuildItem platformHttpEngine(
PlatformHttpRecorder recorder,
VertxWebRouterBuildItem router,
BodyHandlerBuildItem bodyHandler,
List<FeatureBuildItem> features,
UploadAttacherBuildItem uploadAttacher) {

List<Handler<RoutingContext>> handlers = new ArrayList<>();

//
// When RESTEasy is added to the classpath, then the routes are paused
// so we need to resume them.
//
// https://github.com/quarkusio/quarkus/issues/4564
//
// TODO: remove this once the issue get fixed
//
if (features.stream().map(FeatureBuildItem::getInfo).anyMatch("resteasy"::equals)) {
handlers.add(new PlatformHttpHandlers.Resumer());
}

handlers.add(bodyHandler.getHandler());

return new PlatformHttpEngineBuildItem(
recorder.createEngine(router.getRouter(), handlers, uploadAttacher.getInstance()));
recorder.createEngine(
router.getRouter(),
Collections.singletonList(bodyHandler.getHandler()),
uploadAttacher.getInstance()));
}

@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep
CamelRuntimeBeanBuildItem platformHttpEngineBean(PlatformHttpRecorder recorder, PlatformHttpEngineBuildItem engine) {
CamelRuntimeBeanBuildItem platformHttpEngineBean(PlatformHttpEngineBuildItem engine) {
return new CamelRuntimeBeanBuildItem(
PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME,
QuarkusPlatformHttpEngine.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void registrySetUp() {
.body(
PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME, is(QuarkusPlatformHttpEngine.class.getName()),
PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME, is(PlatformHttpComponent.class.getName()),
"handlers-size", is(2));
"handlers-size", is(1));
}

@Test
Expand Down

0 comments on commit 3d618af

Please sign in to comment.