{"record":{"id":"62c8ae6d8136cfc6","repo":"quarkusio/quarkus","slug":"multiple-endpoints-s-s-define-the-same-endpoi","errorCode":null,"errorMessage":"Multiple endpoints [%s, %s] define the same endpoint id: %s","messagePattern":"Multiple endpoints \\[(.+?), (.+?)\\] define the same endpoint id: (.+?)","errorType":"validation","errorClass":"WebSocketServerException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketProcessor.java","lineNumber":372,"sourceCode":"                path = getPath(webSocketAnnotation.value(\"path\").asString());\n                if (beanClass.nestingType() == NestingType.INNER) {\n                    // Sub-websocket - merge the path from the enclosing classes\n                    path = mergePath(getPathPrefix(index, beanClass.enclosingClass()), path);\n                }\n                DotName prevPath = serverPathToEndpoint.put(path, beanClass.name());\n                if (prevPath != null) {\n                    throw new WebSocketServerException(\n                            String.format(\"Multiple endpoints [%s, %s] define the same path: %s\", prevPath, beanClass, path));\n                }\n                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();","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/deployment/src/main/java/io/quarkus/websockets/next/deployment/WebSocketProcessor.java#L354-L390","documentation":"Every server endpoint has an id, taken from @WebSocket(endpointId=...) or defaulting to the class name. Ids must be unique because WebSocketConnection.ConnectionOpenOptions/endpoints are looked up by id; a collision fails deployment with WebSocketServerException.","triggerScenarios":"Two @WebSocket classes both declaring the same endpointId value, or one explicitly set equal to another class's implicit id (the fully-qualified class name).","commonSituations":"Copying an endpoint with its endpointId attribute; refactoring class names so a chosen endpointId now collides; generating endpoints where ids are templated incorrectly.","solutions":["Change the endpointId value on one of the endpoints","Remove the explicit endpointId so the unique class name is used","Search the codebase for the duplicated endpointId string to find both occurrences"],"exampleFix":"// before\n@WebSocket(path=\"/a\", endpointId=\"chat\") class A {}\n@WebSocket(path=\"/b\", endpointId=\"chat\") class B {}\n// after\n@WebSocket(path=\"/b\", endpointId=\"chat-admin\") class B {}","handlingStrategy":"validation","validationCode":"@Test\nvoid endpointIdsUnique() {\n  Set<String> ids = new HashSet<>();\n  for (Class<?> c : allEndpoints) {\n    WebSocket ws = c.getAnnotation(WebSocket.class);\n    String id = ws.endpointId().isEmpty() ? c.getName() : ws.endpointId();\n    if (!ids.add(id)) throw new AssertionError(\"Duplicate endpointId: \" + id);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set endpointId when you actually need a custom id; default FQCN ids never collide","Reference ids via a shared constants class instead of string literals","Update all connection-open call sites when renaming ids"],"tags":["websocket","build-time","endpoint-id","duplicate"],"backgroundTag":"duplicate-endpoint-id","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}