-
Notifications
You must be signed in to change notification settings - Fork 16
Favorite Zone
Nadim Benabdenbi edited this page Dec 7, 2017
·
2 revisions
The favorite zone predicate is a composite predicate evaluated as follow:
- Matches the favorite zone key against the target server zone using the dynamic zone matcher
- Matches the current service zone against the target server zone using the zone affinity matcher
- Matches the upstream zone key against the target server zone using the dynamic zone matcher
- Applies the default ribbon zone avoidance predicate along with the availability predicate
- Matches any server
@RibbonClients(defaultConfiguration = RibbonClientsConfig.class)
@SpringBootApplication
public class Application{
...
}
@Configuration
@EnableRibbonFavoriteZone
public class RibbonClientsConfig {
}
ribbon.extensions.rule.favorite-zone.enabled=true
ribbon.extensions.rule.favorite-zone.key=favorite-zone
ribbon.extensions.propagation.upStreamZone.key=upstream-zone
ribbon.extensions.client.my-client-name.rule.favorite-zone.enabled=true
ribbon.extensions.rule.my-client-name.rule.favorite-zone.key=my-favorite-zone
Where my-client-name is the ribbon client name
Where current() refers to ExecutionContextHolder.current()