This topic created in 1295 days ago, the information mentioned may be changed or developed.
最近使用 Spring Cloud Gateway 搭建了个网关学习学习,请问如果我想在过滤器中调用内部其它 restful 接口,最佳实践是什么?
如果我直接用 openfeign 调用传统基于 servlet 的接口(比如进行权限相关的校验),IDE 都会提示不要在 webflux 中使用阻塞式调用,那请问各位应该怎么做呢?
刚刚学习响应式,很多都不是很懂,希望大佬不吝赐教。
5 replies • 2022-10-27 14:35:26 +08:00
 |
|
1
AerithLoveMe Oct 27, 2022
还是说这样本来就不好,应该把其它接口也做成基于 webflux 的?
|
 |
|
2
leafre Oct 27, 2022
现在没必要学这个,直接 k8s
|
 |
|
3
goofish Oct 27, 2022
响应式编程这玩意太复杂,你把握不住。有兴趣可以看看 Scala 里的 Future 和 web 框架 Play 是怎么写 web 接口的,Future 的功能比 java 强大很多
|
 |
|
5
taixujianyi Oct 27, 2022
可以用 spring-webflux 中的 org.springframework.web.reactive.function.client.WebClient 进行调用
|