0

I followed this page: https://spring.io/guides/gs/service-registration-and-discovery/

and so far no problem. I can register Spring services which are automatically discovered.

I need now to discover services accessible on a specific domain (to distinguish between TEST and PROD, for example)

This means I'll have 2 discovery services which will run. One should fetch services only on myTestDomain.domain.ch, and the other one only on myProdDomain.domain.ch.

Anyone has an idea how to do the distinction ?

daniel.eichten
  • 2,535
  • 19
  • 26
hublo
  • 1,010
  • 2
  • 12
  • 33
  • 1
    And what is actually your question? If you already will run two instances you will just have to distinguish to which registry a service should connect during startup. This is something which you can easily achieve using spring profiles and passing in different values for `eureka.client.service-url.defaultZone` (running outside of AWS) for your different zones. If you want to register different services with the same Eureka instance you could do as well but will have to change the `app-name` of the service that is registering itself. – daniel.eichten Jun 28 '16 at 11:59
  • Thanks @daniel.eichten , this was the property I was looking for! – hublo Jun 28 '16 at 12:32

1 Answers1

0

You should use different profiles to define different eureka zone url for test/prod environment. Then package/run you app with the that profile.

Mavlarn
  • 3,807
  • 2
  • 37
  • 57