{"record":{"id":"caba7b40a8f4dbe8","repo":"OpenFeign/feign","slug":"options-should-be-provided-directly-during-constru","errorCode":null,"errorMessage":"Options should be provided directly during construction of Vertx WebClient.","messagePattern":"Options should be provided directly during construction of Vertx WebClient\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"vertx/feign-vertx/src/main/java/feign/VertxFeign.java","lineNumber":367,"sourceCode":"\n      return target(new Target.HardCodedTarget<>(apiType, url));\n    }\n\n    /**\n     * Defines target and builds client.\n     *\n     * @param target target instance\n     * @param <T> class of API interface\n     * @return built client\n     */\n    @Override\n    public <T> T target(final Target<T> target) {\n      return build().newInstance(target);\n    }\n\n    @Override\n    public Feign.Builder options(final Request.Options options) {\n      throw new UnsupportedOperationException(\n          \"Options should be provided directly during construction of Vertx WebClient.\");\n    }\n\n    @Override\n    public VertxFeign internalBuild() {\n      checkNotNull(\n          this.webClient, \"Vertx WebClient instance wasn't provided in VertxFeign builder\");\n\n      final VertxHttpClient client = new VertxHttpClient(webClient, timeout, requestPreProcessor);\n      final VertxMethodHandler.Factory methodHandlerFactory =\n          new VertxMethodHandler.Factory(\n              client, retryer, requestInterceptors, logger, logLevel, decode404);\n      final ParseHandlersByName handlersByName =\n          new ParseHandlersByName(\n              contract,\n              encoder,\n              decoder,\n              queryMapEncoder,","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/vertx/feign-vertx/src/main/java/feign/VertxFeign.java#L349-L385","documentation":"VertxFeign's builder overrides Feign.Builder.options() to reject per-builder Request.Options because with a reactive Vertx WebClient, timeouts/connect options must be configured on the WebClient itself at construction time. Calling options(...) throws UnsupportedOperationException with guidance to configure options directly on the WebClient.","triggerScenarios":"Calling .options(new Request.Options(...)) on a VertxFeign builder (obtained via VertxFeign.builder() / its Feign.Builder view) before target(), e.g. code ported from standard Feign configuration that sets timeouts via the builder.","commonSituations":"Migrating a plain Feign client setup to VertxFeign and copying the .options(...) line; central Feign configuration helpers that always call options(); attempting to raise read timeouts for slow endpoints in a Vertx setup.","solutions":["Remove the .options(...) call and instead configure timeouts/connect options on the WebClient (e.g. WebClientOptions with connectTimeout/readTimeout/idleTimeout) passed to VertxFeign.builder().","If using HttpClientOptions/RequestOptions, set them when creating the WebClient so every Feign request inherits them.","Centralize the settings in WebClient creation code rather than the Feign builder to avoid the exception path entirely."],"exampleFix":"// before\nVertxFeign.builder().options(new Request.Options(10, 60_000)).target(Api.class, url);\n// after\nWebClient client = WebClient.create(vertx,\n    new WebClientOptions().setConnectTimeout(10_000).setIdleTimeout(60));\nVertxFeign.builder().webClient(client).target(Api.class, url);","handlingStrategy":"validation","validationCode":"// Configure on WebClient, never call .options on VertxFeign builder\nWebClientOptions opts = new WebClientOptions()\n    .setConnectTimeout(10_000)\n    .setIdleTimeout(60);\nWebClient webClient = WebClient.create(vertx, opts);\njava.util.Objects.requireNonNull(webClient, \"WebClient with options required for VertxFeign\");","typeGuard":null,"tryCatchPattern":"try {\n  builder.options(new Request.Options(10, 60_000));\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Options should be provided directly\")) {\n    // move options into WebClientOptions and rebuild WebClient\n  }\n  throw e;\n}","preventionTips":["Never copy plain-Feign .options(...) calls into VertxFeign builders.","Set all timeouts in WebClientOptions at WebClient construction.","Keep a shared factory function that builds the configured WebClient for all VertxFeign clients."],"tags":["vertx","configuration","unsupported-operation","options","timeout"],"backgroundTag":"conflicting-config-options","analyzedSha":"e2a1e27560a1e68840c34f031afca88b36096e30","analyzedAt":"2026-09-10T12:37:37.238Z","contentChangedAt":"2026-09-10T12:37:37.238Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}