I have a question regarding a specific case with our product.
Let's say I have two services; Service A
and Service B
. (The number of services varies from an installation to installation). They are deployed into our Docker Swarm. They do not publish any ports, meaning that they are not reachable from outside our Swarm cluster. And I have an Nginx container, which publishes a port to outside of Swarm, and which we use as reverse proxy.
Service A
and Service B
do very similar things, which one will be called is up to our client's preferences. We would like our clients to use the same endpoint (say HTTP POST /some-event
) to access those services but also pick a service (Service A
or Service B
) by providing something extra with the request context.
For example, we thought of implementing yet another server with access to Service A
and Service B
, creating access keys for both services, writing them to database and providing our clients with the access keys. This new server will be the only recipient of HTTP POST /some-event
and will route the request to Service A
or Service B
depending on the access key provided with request context (say in header, etc.) But this seemed like reinventing the wheel.
I am also looking into Netflix Zuul, but this solution involves writing a Zuul configuration every time we deploy our product (depending on how many service we deploy with each installation).
So the question is; what might be alternative ways of achieving dynamic routing with Headers for requests made to the same resource/service? Thanks!