Set a list of acceped zones in Eureka

Viewed 661

Is their a way to ignore zone or define list of accepted zone in Eureka, for example if we have 3 zones ( office, shahbour, joe )

I want the services in zone shahbour to only use services defined in shahbour primary and office as secondary and ignore all other zones in this example joe.

I tried it as below and it is working to prefer same zone but if their is no service on same zone it do load balance on all the others zones

spring:
  profiles: shahbour
eureka:
  instance:
    metadataMap:
      zone: shahbour
  client:
    region: lebanon
    serviceUrl:
      defaultZone: http://office:8761/eureka/
    preferSameZoneEureka: true
    availabilityZones:
      lebanon: shahbour,office

I thought setting availabilityZones set this but it is not .

This is for development environment where i am trying to setup each developer to use his machine as a zone and if service does not exist use office server as backup but don't use other developers .

1 Answers
Related