Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

原书第二版67页的DefaultRibbonConfig的IClientConfig启动时报bean不存在,源码中也搜索不到,请问这个类的Bean需要自己实现吗? #11

Open
xn-9527 opened this issue Nov 18, 2019 · 0 comments

Comments

@xn-9527
Copy link

xn-9527 commented Nov 18, 2019

原书第二版67页的DefaultRibbonConfig的IClientConfig启动时报bean不存在,作者提供的配套源码中也搜索不到实现,请问这个类的Bean需要自己实现吗?如果是要自己实现的话,请问如何设置参数?

报错如下:

Parameter 0 of method ribbonServerList in config.DefaultRibbonConfig required a bean of type 'com.netflix.client.config.IClientConfig' that could not be found.


Action:

Consider defining a bean of type 'com.netflix.client.config.IClientConfig' in your configuration.

书上源码:

@Configuration
public class DefaultRibbonConfig {
    @Bean
    public IRule ribbonRule() {
        return new BestAvailableRule();
    }

    @Bean
    public IPing ribbonPing() {
        return new PingUrl();
    }

    @Bean
    public ServerList<Server> ribbonServerList(IClientConfig clientConfig) {
        return new RibbonClientDefaultConfigurationTestsConfig.BazServiceList(clientConfig);
    }

    @Bean
    public ServerListSubsetFilter severListFilter() {
        return new ServerListSubsetFilter();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant