I am developing a specialized, dynamic Web application router using Spring Netflix Eureka, Zuul, and Ribbon. I need to know what server was chosen by the Ribbon load balancer from the pool of servers registered with a given service id in Eureka for the request being routed.
It doesn't seem that Zuul tracks the server chosen by Ribbon in the RequestContext.
Context: This is not traditional stateless REST service routing. This router is managing pools of legacy Java Web apps that use unsharable (at the moment) sessions. These legacy servers are being retrofitted as Spring Boot Eureka aware applications. They will register with Eureka under a given server id. They will also register a GUID as Eureka metadata that uniquely defines that executing instance of the app.
I am implementing a sticky session scheme which will associate Java session ids with the unique server ids (the GUID) of the server that generated the session.
Thus when a request with a session cookie is received, I will use the Ribbon rule and predicate filter I've already written (for other reasons) to filter the list of servers to only the one who's GUID is associated with the session.
There may be other ways of doing this, but in my case, I have all the material I need except the knowledge of what server actually executed the request.