spring-cloud-rsocket icon indicating copy to clipboard operation
spring-cloud-rsocket copied to clipboard

How can I connect to the gateway via JavaScript webclient?

Open nuradinnur opened this issue 5 years ago • 1 comments

Hi,

I'm using rsocket-websocket-client to connect to the gateway. However, I always get this particular exception since I do not set a routeId in my client.

java.lang.NullPointerException: null at java.base/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) ~[na:na] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.MonoDefer] : reactor.core.publisher.Mono.defer org.springframework.cloud.gateway.rsocket.filter.AbstractFilterChain.filter(AbstractFilterChain.java:104) Error has been observed at the following site(s): |_ Mono.defer ⇢ at org.springframework.cloud.gateway.rsocket.filter.AbstractFilterChain.filter(AbstractFilterChain.java:104) |_ Mono.log ⇢ at org.springframework.cloud.gateway.rsocket.socketacceptor.GatewaySocketAcceptor.accept(GatewaySocketAcceptor.java:113) |_ Mono.map ⇢ at org.springframework.cloud.gateway.rsocket.socketacceptor.GatewaySocketAcceptor.accept(GatewaySocketAcceptor.java:115) |_ Mono.then ⇢ at io.rsocket.RSocketFactory$ServerRSocketFactory$ServerStart.lambda$null$3(RSocketFactory.java:674) |_ Mono.onErrorResume ⇢ at io.rsocket.RSocketFactory$ServerRSocketFactory$ServerStart.lambda$acceptSetup$6(RSocketFactory.java:673) ...

I do not want users of the webclients to register themselves as separate microservices. How can I bypass the GatewaySocketAcceptor such that webclients are exempted from adding themselves in the RoutingTable?

Thank you in advance! And I'm terribly sorry if this is the wrong place for this type of question. I would use stackoverflow but it seems as though there is no way to accomplish what I'm looking for, currently.

nuradinnur avatar Feb 03 '20 01:02 nuradinnur

Apologies, the closure was a misclick 😄...

Additionally, I'd like to add that I would attempt to use the same routeId for all webclients if I was absolutely required to add one, but all clients must use different routeIds.

nuradinnur avatar Feb 03 '20 01:02 nuradinnur