0

Very new to Spring/Eureka, sorry if this is a dumb question:

I have multiple services, all implementing a common interface. I need to dynamically (at runtime) select the correct implementation. For example, I may have a front end that services multiple payroll systems. I want to select the correct payroll system based on some attribute.

I don't want to have to define multiple endpoints for each (if I start servicing an additional system, I don't want to have to add even more endpoints).

What I want to do is locate the correct service (maybe construct the name dynamically based on the desired payroll system) and interact via the interface. Does that make sense? Possible? Obvious?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Lonnie Lewis
  • 65
  • 1
  • 6

2 Answers2

0

This sounds like a perfect candidate for auto-configuration.

Take a look here Creating your own auto-configuration

ryan2049
  • 361
  • 1
  • 8
0

You may need to write your custom router strategy with Spring Cloud Netflix which can deliver your request to different microservice according to your rule .

Pencilcap
  • 33
  • 1
  • 5