{"record":{"id":"fb327563aa44e979","repo":"OpenFeign/feign","slug":"invocation-handler-factory-overrides-are-not-suppo-fb3275","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/RxJavaFeign.java","lineNumber":45,"sourceCode":"public class RxJavaFeign extends ReactiveFeign {\n\n  public static Builder builder() {\n    return new Builder();\n  }\n\n  public static class Builder extends ReactiveFeign.Builder {\n\n    private Scheduler scheduler = Schedulers.trampoline();\n\n    @Override\n    public Feign internalBuild() {\n      super.invocationHandlerFactory(new RxJavaInvocationHandlerFactory(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    public Builder scheduleOn(Scheduler scheduler) {\n      this.scheduler = scheduler;\n      return this;\n    }\n  }\n\n  private static class RxJavaInvocationHandlerFactory implements InvocationHandlerFactory {\n    private final Scheduler scheduler;\n\n    private RxJavaInvocationHandlerFactory(Scheduler scheduler) {\n      this.scheduler = scheduler;\n    }\n\n    @Override\n    public InvocationHandler create(Target target, Map<Method, MethodHandler> dispatch) {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/OpenFeign/feign/blob/e2a1e27560a1e68840c34f031afca88b36096e30/reactive/src/main/java/feign/reactive/RxJavaFeign.java#L27-L63","documentation":"RxJavaFeign.Builder installs its own RxJavaInvocationHandlerFactory to adapt calls to Observable/Single with the configured Scheduler. Overriding the invocation handler factory would break the reactive dispatch, so the override throws UnsupportedOperationException unconditionally.","triggerScenarios":"Calling RxJavaFeign.builder().invocationHandlerFactory(customFactory) while building an RxJava reactive target.","commonSituations":"Copying builder configuration from plain Feign code; shared builder utilities that add InvocationHandlerFactory wrappers for logging/metrics.","solutions":["Remove the invocationHandlerFactory(...) call from the RxJavaFeign builder chain","Implement cross-cutting concerns via RxJava operators (map, doOnNext, subscribeOn) or a custom Client/Decoder","Use classic Feign.builder() if a custom InvocationHandlerFactory is required"],"exampleFix":"// before\nRxJavaFeign.builder().invocationHandlerFactory(new MyFactory()).target(Api.class, url);\n// after\nRxJavaFeign.builder().target(Api.class, url);\n","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"if (builder instanceof feign.reactive.RxJavaFeign.Builder) {\n  // invocationHandlerFactory() is not allowed here\n}","tryCatchPattern":null,"preventionTips":["Never mix classic Feign builder options into RxJavaFeign's builder","Use RxJava operators or custom Client/Decoder for cross-cutting behavior"],"tags":["reactive","rxjava","builder"],"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"}