spring-attic / spring-cloud-rsocket

This repository is now inactive. Please see https://github.com/rsocket-routing/
https://github.com/rsocket-routing/
Apache License 2.0
49 stars 13 forks source link

How can I connect to the gateway via JavaScript webclient? #13

Open nuradinnur opened 4 years ago

nuradinnur commented 4 years ago

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 commented 4 years ago

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.