{"record":{"id":"519690aad55d0f1b","repo":"quarkusio/quarkus","slug":"only-one-server-sendinginterceptor-is-supported","errorCode":null,"errorMessage":"Only one server SendingInterceptor is supported","messagePattern":"Only one server 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":127,"sourceCode":"    }\n\n    void pathToClientErrorInterceptor(Function<String, ErrorInterceptor> pathToClientErrorInterceptor) {\n        Objects.requireNonNull(pathToClientErrorInterceptor);\n        if (this.pathToClientErrorInterceptor == null) {\n            this.pathToClientErrorInterceptor = pathToClientErrorInterceptor;\n        } else {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one client ErrorInterceptor is supported\");\n        }\n    }\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    }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java#L109-L145","documentation":"Thrown by WebSocketTelemetryProviderBuilder.pathToServerSendingInterceptor when a second server SendingInterceptor registration arrives while one is already installed (the field is non-null). The builder currently supports exactly one interceptor of this kind — the comment notes a composite could be added later — so the duplicate registration guard rejects it, mirroring the sibling pathToClientErrorInterceptor check for ErrorInterceptor.","triggerScenarios":"Calling pathToServerSendingInterceptor(...) when the field is already non-null.","commonSituations":"Multiple telemetry providers or extensions each contributing a server sending interceptor during the same build/initialization.","solutions":["Register only one server sending interceptor function","Combine interceptor logic into a single composite Function","Identify and remove the duplicate contributor"],"exampleFix":"// before\nbuilder.pathToServerSendingInterceptor(a);\nbuilder.pathToServerSendingInterceptor(b);\n// after\nbuilder.pathToServerSendingInterceptor(path -> path.startsWith(\"/ws\") ? b.apply(path) : a.apply(path));","handlingStrategy":"validation","validationCode":"if (builder.pathToServerSendingInterceptor != null) throw new IllegalStateException(\"already registered\");","typeGuard":null,"tryCatchPattern":"try { builder.pathToServerSendingInterceptor(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"}