{"record":{"id":"1fc5eb1c7e3be88d","repo":"quarkusio/quarkus","slug":"multiple-client-endpoints-s-s-define-the-same","errorCode":null,"errorMessage":"Multiple client endpoints [%s, %s] define the same path: %s","messagePattern":"Multiple client endpoints \\[(.+?), (.+?)\\] define the same path: (.+?)","errorType":"validation","errorClass":"WebSocketServerException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketProcessor.java","lineNumber":382,"sourceCode":"                AnnotationValue endpointIdValue = webSocketAnnotation.value(\"endpointId\");\n                if (endpointIdValue == null) {\n                    id = beanClass.name().toString();\n                } else {\n                    id = endpointIdValue.asString();\n                }\n                DotName prevId = serverIdToEndpoint.put(id, beanClass.name());\n                if (prevId != null) {\n                    throw new WebSocketServerException(\n                            String.format(\"Multiple endpoints [%s, %s] define the same endpoint id: %s\", prevId, beanClass,\n                                    id));\n                }\n                inboundProcessingMode = webSocketAnnotation.value(\"inboundProcessingMode\");\n            } else {\n                target = Target.CLIENT;\n                path = getPath(webSocketClientAnnotation.value(\"path\").asString());\n                DotName prevPath = clientPathToEndpoint.put(path, beanClass.name());\n                if (prevPath != null) {\n                    throw new WebSocketServerException(\n                            String.format(\"Multiple client endpoints [%s, %s] define the same path: %s\", prevPath, beanClass,\n                                    path));\n                }\n                AnnotationValue clientIdValue = webSocketClientAnnotation.value(\"clientId\");\n                if (clientIdValue == null) {\n                    id = beanClass.name().toString();\n                } else {\n                    id = clientIdValue.asString();\n                }\n                DotName prevId = clientIdToEndpoint.put(id, beanClass.name());\n                if (prevId != null) {\n                    throw new WebSocketServerException(\n                            String.format(\"Multiple client endpoints [%s, %s] define the same endpoint id: %s\", prevId,\n                                    beanClass,\n                                    id));\n                }\n                inboundProcessingMode = webSocketClientAnnotation.value(\"inboundProcessingMode\");\n            }","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketProcessor.java#L364-L400","documentation":"Analogous to server endpoints, client endpoints (@WebSocketClient) register their paths in a build-time map; duplicate client paths are ambiguous for connection creation and raise WebSocketServerException at deployment.","triggerScenarios":"Two @WebSocketClient classes with the same path attribute value, e.g. both \"ws://localhost:8080/ws\" or the same relative path template.","commonSituations":"Copy-pasting a client class without changing its path; multiple clients targeting the same server endpoint intentionally but declared identically.","solutions":["Give each @WebSocketClient a distinct path value","If both clients intentionally target the same server path, differentiate them with path expressions/properties, e.g. path = \"${client.a.path}\" and \"${client.b.path}\"","Remove one of the duplicate client endpoints"],"exampleFix":"// before\n@WebSocketClient(path = \"ws://host/ws\") class C1 {}\n@WebSocketClient(path = \"ws://host/ws\") class C2 {}\n// after\n@WebSocketClient(path = \"ws://host/ws\") class C1 {}\n@WebSocketClient(path = \"ws://host/ws2\") class C2 {}","handlingStrategy":"validation","validationCode":"@Test\nvoid clientPathsUnique() {\n  Set<String> paths = new HashSet<>();\n  for (Class<?> c : allClients) {\n    if (!paths.add(c.getAnnotation(WebSocketClient.class).path()))\n      throw new AssertionError(\"Duplicate client path\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive client paths from config properties so environments cannot silently collide","Keep one client class per server endpoint target","Review path templates when duplicating client code"],"tags":["websocket","build-time","client","duplicate-path"],"backgroundTag":"duplicate-route-path","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}