Sharing registry and gateway is probably a bad idea. Full stack developers should run the gateway and registry locally on their PC, only share UAA if you really want to share something.
If you still want to do it, you could get inspired by how to manage multiple versions of a web API on a gateway.
After all, in your case, each developer wants to use his/her own version of the API.
- From client side, this can be done through URL or through an HTTP header. This means that you are able to configure client code to require a specific version.
- This extra information in request would then get used by gateway for routing to the service that matches the requested version.
- This works only if Zuul proxy in gateway knows about which version is supported by which service instance. It means that each instance must add this version information to their Eureka regsitration.
Here are 2 ideas that you could try:
- version in URL: define a spring profile (e.g.
user
) and use it to set a different application name in bootstrap-user.yml
- version in header: add some property to Eureka metadata map (
eureka.instance.metadataMap
in bootstrap.yml
) and modify the gateway so that it uses this info for routing.
Have a look at Spring Cloud Eureka server docs to get a good understanding about how this works and you could get even better ideas.
Here is an article about API versioning that could inspire you too: https://tech.asimio.net/2017/03/06/Multi-version-Service-Discovery-using-Spring-Cloud-Netflix-Eureka-and-Ribbon.html