1

I'm using Netflix Eureka and Ribbon as a discovery service and a loadbalancer.

Ribbon should choose an available service for me, let's call that service "finder".

What I want is to let ribbon choose a "finder" service, send a message to that service, and then send it another message (to the same service). Meaning, I need to "remember" which service was selected for the first message in order to send the second message.

Any ideas?

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
alex_bl
  • 21
  • 4
  • Why do you want to send the second message to the same service? You shouldn't maintain any state in your services this will break high availability – Simon Martinelli Dec 13 '17 at 15:12
  • Yes, I know, but there's no other way. I have architectural restrictions that I can't override. Instead of sending one message for each instance each time, I need to send two. – alex_bl Dec 13 '17 at 15:17
  • Have a look at this: https://stackoverflow.com/questions/29218071/sticky-sessions-and-zuul-in-spring-cloud – Simon Martinelli Dec 13 '17 at 15:20
  • Using a Zuul proxy, as described in the link from @SimonMartinelli , is probably your best shot. Could you elaborate on what your restrictions are? For example, would it be permissible to not use the ribbon client for this particular service call? – Pytry Dec 13 '17 at 23:27
  • Well, the restrictions are simple - I have to use ribbon as my loadbalancer, and I can't use Zuul as a router. – alex_bl Dec 14 '17 at 12:35

0 Answers0