Skip to content

Strict Metadata Matcher

enadim edited this page Nov 14, 2017 · 3 revisions

Strict Metadata Matcher

Strict metadata matcher is designed to target servers with a specific set of metadata info. It does a round robin balancing when multiple servers have the desired set of metadata info.

⚠️ If no server has the desired metadata info the routing will fail.

Usage

@RibbonClients(defaultConfiguration = RibbonClientsConfig.class)
@SpringBootApplication
public class Application{
...
}

@Configuration
@EnableRibbonDynamicMatcher
public class RibbonClientsConfig {
}

Configuration

Default configuration

ribbon.extensions.rule.dynamic-matcher.enabled=true
ribbon.extensions.rule.dynamic-matcher.key=dynamic-matcher-key

Customization for a specific ribbon client

ribbon.extensions.client.my-client-name.rule.dynamic-matcher.enabled=true
ribbon.extensions.rule.my-client-name.rule.dynamic-matcher.key=my-dynamic-matcher-key

Where my-client-name is the ribbon client name

Illustration

Illustration

Where current() refers to ExecutionContextHolder.current()

Clone this wiki locally