Hello, in our project I found strange behaviour with this DefaultSockJsService.

We using spring boot 2.5.5 and this dependencies: org.springframework.boot spring-boot-starter-websocket org.springframework.boot spring-boot-starter-webflux org.springframework.boot spring-boot-starter-reactor-netty

We received next exception: DefaultSockJsService : Invalid SockJS path '/online-security-bundling/process' - required to have 3 path segments

We see this strange behaviour only on prod env in google cloud while receiving requests from google pub/sub. Maybe you know why it's hepenning?

https://github.com/spring-projects/spring-framework/blob/65394b00ea421a75318daef6d60378875868249a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/DefaultSockJsService.java#L43

Comment From: rstoyanchev

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

As you investigate further, the error means the URL path neither has the 3 required path segments (serverId, sessionId, protocolId) required to handle the request by the protocol, and it is also none of the other expected, fixed URL paths such as the root path "/" when starting out, or "/info", or "/websocket".

You'll need to debug the sequence of URLs with understanding of what's expected to understand what happens. There is an overview in our documentation and the protocol itself is not hard to read for further detail.