我们正在尝试为ZUUL编写自定义POST路由过滤器 . 我们正在使用Spring Cloud Zuul . 这就是我们要做的 -
在Eureka注册了多个相同服务(ServiceA)的实例 . 我们通过ZUUL在ServiceA中创建一个rest API请求,并且由在Eureka注册的任何一个实例提供API . What we want to know is the hostip of the instance which services that particulare request.
我们实现了一个POST过滤器,但 RequestContext.getCurrentContext().getRouteHost 为空;有没有其他方法来获得hostip?
1 回答
这个对我有用: