Closed ryzencool closed 4 years ago
You should not be using ip and port in the load balanced URL it needs to be a service id
lb:ws://serviceid
Thanks for your answer, but my netty server is not registed on the springcloud registry like eureka, so it not has serviceId, how to solve it?
In order to use load-balancing, you need to use a supported service-discovery based service resolution. If you do not use service registry, you can try the properties-based SimpleDiscoveryClient
.
If you want to pass IP and PORT instead of using service Ids, you should not prefix the uri
with lb:
and just pass it directly, like in the code sample in this section.
Does this solve your issue?
Yes, Thank you very much. I refactor project by using springboot, and set spring.cloud.zookeeper.discovery.instance-port
as my netty service port.
I hava websocket server cluster use netty, now i use springcloud gateway, i try to use lb:ws://ip:port , but it not work because of serviceIdList is empty. Can springcloud gateway support load balance for netty cluster by doing some configuration?