{"record":{"id":"b8b8b325b8a7d1ea","repo":"OpenFeign/feign","slug":"invocation-handler-factory-overrides-are-not-suppo","errorCode":null,"errorMessage":"Invocation Handler Factory overrides are not supported.","messagePattern":"Invocation Handler Factory overrides are not supported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"reactive/src/main/java/feign/reactive/ReactorFeign.java","lineNumber":53,"sourceCode":"  }\n\n  public static class Builder extends ReactiveFeign.Builder {\n\n    private final Scheduler scheduler;\n\n    Builder(Scheduler scheduler) {\n      this.scheduler = scheduler;\n    }\n\n    @Override\n    public Feign internalBuild() {\n      super.invocationHandlerFactory(new ReactorInvocationHandlerFactory(scheduler));\n      return super.internalBuild();\n    }\n\n    @Override\n    public Builder invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory) {\n      throw new UnsupportedOperationException(\n          \"Invocation Handler Factory overrides are not supported.\");\n    }\n  }\n\n  private static class ReactorInvocationHandlerFactory implements InvocationHandlerFactory {\n    private final Scheduler scheduler;\n\n    private ReactorInvocationHandlerFactory(Scheduler scheduler) {\n      this.scheduler = scheduler;\n    }\n\n    @Override\n    public InvocationHandler create(Target target, Map<Method, MethodHandler> dispatch) {\n      return new ReactorInvocationHandler(target, dispatch, scheduler);\n    }\n  }\n}\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/reactive/src/main/java/feign/reactive/ReactorFeign.java#L35-L71","documentation":"ReactorFeign.Builder installs its own ReactorInvocationHandlerFactory (bound to the configured Scheduler) to return Flux/Mono from proxy calls. Overriding the invocation handler factory would break the reactive dispatch, so the override method throws UnsupportedOperationException unconditionally.","triggerScenarios":"Calling ReactorFeign.builder().invocationHandlerFactory(customFactory) while building a reactive target.","commonSituations":"Copying builder chains from classic Feign code that adds metrics/retry via InvocationHandlerFactory; shared builder-configuration utilities applied to reactive builders.","solutions":["Remove the invocationHandlerFactory(...) call from the ReactorFeign builder chain","Wrap cross-cutting concerns in the Decoder/Encoder/Client or in operators on the returned Flux/Mono instead","Use classic Feign.builder() if a custom InvocationHandlerFactory is a hard requirement"],"exampleFix":"// before\nReactorFeign.builder().invocationHandlerFactory(new MyFactory()).target(Api.class, url);\n// after\nReactorFeign.builder().target(Api.class, url);\n","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"if (builder instanceof feign.reactive.ReactorFeign.Builder) {\n  // invocationHandlerFactory() is not allowed here\n}","tryCatchPattern":null,"preventionTips":["Never mix classic Feign builder options into reactive builders","Put cross-cutting logic in Client/Decoder/Encoder or reactive operators"],"tags":["reactive","builder","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}