WebSocket isFull registration creates an exact-path rule that cannot match endpoint sub-paths
Environment
- ShenYu versions: 2.7.2 (verified in a live deployment), master (code inspection)
- Client:
shenyu-spring-boot-starter-client-spring-websocketwithshenyu.client.websocket.props.isFull=true
Describe the bug
With isFull=true, the websocket client registers metadata whose path is the bare context path:
// SpringWebSocketClientEventListener#getBeans, isFull branch
MetaDataRegisterDTO.builder()
.contextPath(getContextPath())
.path(getContextPath()) // exact path, no wildcard
.ruleName(getContextPath())
shenyu-admin derives the websocket rule pathPattern from this value, so the auto-created rule only matches the context path itself. Any real websocket endpoint below the context path is unreachable through the gateway.
In contrast, the springmvc (divide) client isFull branch registers contextPath + "/**", so HTTP sub-paths work. The websocket client is the odd one out.
Steps to reproduce
- Deploy a service with
server.servlet.context-path=/data/asset, a websocket endpoint at/ws/access/upload, andshenyu.client.websocket.props.isFull=true. - Observe shenyu-admin auto-create websocket selector
/data/assetand rule/data/asset(exact path, no wildcard). - Connect through the gateway:
ws://gateway:9195/data/asset/ws/access/upload. - The handshake fails; the bootstrap logs:
websocket selector success match , selector name :/data/asset
can not match rule data: websocket , path is /data/asset/ws/access/upload
Evidence from a live deployment (2026-11-09)
- selector match:
websocket selector success match , selector name :/data/asset - rule miss:
can not match rule data: websocket , path is /data/asset/ws/access/upload - DB
rule_conditionvalues: websocket plugin =/data/asset(exact) vs divide plugin =/data/asset/**
Expected behavior
The websocket isFull rule should cover the context path and everything below it (/data/asset/**), consistent with the divide client, so endpoints under the context path are reachable through the gateway.
Suggested fix
Align the websocket isFull metadata path with the divide client idiom:
.path(UriComponentsBuilder.fromUriString(
PathUtils.decoratorPathWithSlash(getContextPath()) + EVERY_PATH)
.build().encode().toUriString())