{"record":{"id":"231b2ed921d20e6a","repo":"quarkusio/quarkus","slug":"only-one-client-sendinginterceptor-is-supported","errorCode":null,"errorMessage":"Only one client SendingInterceptor is supported","messagePattern":"Only one client SendingInterceptor is supported","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java","lineNumber":137,"sourceCode":"    }\n\n    void pathToServerSendingInterceptor(Function<String, SendingInterceptor> pathToServerSendingInterceptor) {\n        Objects.requireNonNull(pathToServerSendingInterceptor);\n        if (this.pathToServerSendingInterceptor == null) {\n            this.pathToServerSendingInterceptor = pathToServerSendingInterceptor;\n        } else {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one server SendingInterceptor is supported\");\n        }\n    }\n\n    void pathToClientSendingInterceptor(Function<String, SendingInterceptor> pathToClientSendingInterceptor) {\n        Objects.requireNonNull(pathToClientSendingInterceptor);\n        if (this.pathToClientSendingInterceptor == null) {\n            this.pathToClientSendingInterceptor = pathToClientSendingInterceptor;\n        } else {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one client SendingInterceptor is supported\");\n        }\n    }\n\n    WebSocketTelemetryProvider build() {\n        return new WebSocketTelemetryProvider(serverEndpointDecorator, clientEndpointDecorator,\n                pathToClientConnectionInterceptor, pathToServerConnectionInterceptor, pathToClientSendingInterceptor,\n                pathToServerSendingInterceptor, pathToClientErrorInterceptor, pathToServerErrorInterceptor);\n    }\n\n}\n","sourceCodeStart":119,"sourceCodeEnd":148,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java#L119-L148","documentation":"The builder stores a single Function<String, SendingInterceptor> for client-side sending interceptors. A second registration attempt throws IllegalStateException; composition is intentionally deferred.","triggerScenarios":"Calling pathToClientSendingInterceptor(...) when one is already registered on the builder.","commonSituations":"Two integrations (e.g. tracing and metrics) both wiring client sending interceptors; duplicate recorder invocations at build time.","solutions":["Register only one client sending interceptor function","Merge logic into one composite Function","Remove the duplicate registration source"],"exampleFix":"// before\nbuilder.pathToClientSendingInterceptor(a);\nbuilder.pathToClientSendingInterceptor(b);\n// after\nbuilder.pathToClientSendingInterceptor(path -> a.apply(path) == null ? b.apply(path) : a.apply(path));","handlingStrategy":"validation","validationCode":"if (builder.pathToClientSendingInterceptor != null) throw new IllegalStateException(\"already registered\");","typeGuard":null,"tryCatchPattern":"try { builder.pathToClientSendingInterceptor(fn); } catch (IllegalStateException e) { /* handle duplicate */ }","preventionTips":["Single registration site per interceptor type"],"tags":["websockets","interceptor","configuration"],"backgroundTag":"duplicate-interceptor-registration","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"}