{"record":{"id":"42a67b0265c822da","repo":"quarkusio/quarkus","slug":"this-method-is-not-supported-using-this-builder-u-42a67b","errorCode":null,"errorMessage":"This method is not supported using this builder. Use #routeFunction(String, Consumer<Route>)","messagePattern":"This method is not supported using this builder\\. Use #routeFunction\\(String, Consumer<Route>\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/NonApplicationRootPathBuildItem.java","lineNumber":282,"sourceCode":"    }\n\n    /**\n     * Per non-application endpoint instance.\n     */\n    public static class Builder extends RouteBuildItem.Builder {\n        private final NonApplicationRootPathBuildItem buildItem;\n        private RouteBuildItem.RouteType routeType = RouteBuildItem.RouteType.FRAMEWORK_ROUTE;\n        private RouteBuildItem.RouteType routerType = RouteBuildItem.RouteType.FRAMEWORK_ROUTE;\n        private String name;\n        private String path;\n\n        Builder(NonApplicationRootPathBuildItem buildItem) {\n            this.buildItem = buildItem;\n        }\n\n        @Override\n        public Builder routeFunction(Function<Router, Route> routeFunction) {\n            throw new RuntimeException(\n                    \"This method is not supported using this builder. Use #routeFunction(String, Consumer<Route>)\");\n        }\n\n        public Builder routeFunction(String route, Consumer<Route> routeFunction) {\n            return orderedRoute(route, null, routeFunction);\n        }\n\n        @Override\n        public Builder route(String route) {\n            routeFunction(route, null);\n            return this;\n        }\n\n        @Override\n        public Builder orderedRoute(String route, Integer order) {\n            orderedRoute(route, order, null);\n            return this;\n        }","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/NonApplicationRootPathBuildItem.java#L264-L300","documentation":"NonApplicationRootPathBuildItem.Builder intentionally rejects the generic routeFunction(Function<Router,Route>) overload because the framework needs an explicit path string to compute the final non-application route. The builder throws unconditionally in this overload to steer callers toward the path-aware routeFunction(String, Consumer<Route>) variant. This is a compile-time-avoidable but runtime-enforced API contract within the Quarkus build-time framework.","triggerScenarios":"Calling builder.routeFunction(Function<Router,Route>) on the Builder obtained from a NonApplicationRootPathBuildItem's Builder constructor; the throw is unconditional on that overload.","commonSituations":"Extension authors porting code that builds application RouteBuildItems (where the Function overload is legal) to non-application root (framework/dev console/management) routes; copy-pasting a builder chain that used the Function overload elsewhere.","solutions":["Replace the call with routeFunction(String route, Consumer<Route>) passing an explicit path, e.g. builder.routeFunction(\"/my-endpoint\", route -> route.handler(handler))","If a Router-level function is required, use the Builder's orderedRoute(path, order, consumer) methods which accept paths","Check which builder class you hold: NonApplicationRootPathBuildItem.Builder disallows the Function overload while other route builders allow it"],"exampleFix":"// before\nbuilder.routeFunction(router -> router.route(\"/framework/foo\").handler(handler));\n// after\nbuilder.routeFunction(\"/framework/foo\", route -> route.handler(handler));","handlingStrategy":"validation","validationCode":"boolean isNonAppBuilder = builder instanceof NonApplicationRootPathBuildItem.Builder;\nif (isNonAppBuilder) {\n    // use routeFunction(String, Consumer<Route>) only\n    assert path != null && !path.isBlank() : \"non-application routes need an explicit path\";\n}","typeGuard":"boolean supportsFunctionOverload(Object builder) {\n    return !(builder instanceof NonApplicationRootPathBuildItem.Builder);\n}","tryCatchPattern":null,"preventionTips":["Always pair route registration with an explicit path string on NonApplicationRootPathBuildItem.Builder","Never copy builder chains written for application RouteBuildItem.Builder onto non-application builders","Use the String-path overloads (routeFunction(String, Consumer<Route>), orderedRoute) exclusively for framework/console/management routes"],"tags":["quarkus","vertx-http","build-time","unsupported-api","routing"],"backgroundTag":"unsupported-builder-method","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}