Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workaround for https://github.com/quarkusio/quarkus/issues/4564 as it seems to be fixed #445

Merged
merged 1 commit into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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