From 9b83a7cb655dc309f5283d798531a0b484ede52d Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Thu, 3 Aug 2023 15:46:12 +0200 Subject: [PATCH] SmallRyeGraphQLOverWebSocketHandler: use order value > Integer.MIN_VALUE - so that it's possible to register a route/filter that is executed before this handler - fixes #34908 (cherry picked from commit 2be7e958493f2a947be72120d03ccfa9b3e55e52) --- .../smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java b/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java index 3febad882c0f5..f9743035cf9c5 100644 --- a/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java +++ b/extensions/smallrye-graphql/deployment/src/main/java/io/quarkus/smallrye/graphql/deployment/SmallRyeGraphQLProcessor.java @@ -144,6 +144,8 @@ public class SmallRyeGraphQLProcessor { private static final List SUPPORTED_WEBSOCKET_SUBPROTOCOLS = List.of(SUBPROTOCOL_GRAPHQL_WS, SUBPROTOCOL_GRAPHQL_TRANSPORT_WS); + private static final int GRAPHQL_WEBSOCKET_HANDLER_ORDER = -10000; + @BuildStep void feature(BuildProducer featureProducer) { featureProducer.produce(new FeatureBuildItem(Feature.SMALLRYE_GRAPHQL)); @@ -368,7 +370,7 @@ void buildExecutionEndpoint( runBlocking); HttpRootPathBuildItem.Builder subscriptionsBuilder = httpRootPathBuildItem.routeBuilder() - .orderedRoute(graphQLConfig.rootPath, Integer.MIN_VALUE) + .orderedRoute(graphQLConfig.rootPath, GRAPHQL_WEBSOCKET_HANDLER_ORDER) .handler(graphqlOverWebsocketHandler); routeProducer.produce(subscriptionsBuilder.build());