Netflix / eureka

AWS Service registry for resilient mid-tier load balancing and failover.
Apache License 2.0
12.43k stars 3.75k forks source link

i cont inject EurekaJerseyClient bean into DiscoveryClient.java#L270 #1038

Closed yangguang001 closed 6 years ago

yangguang001 commented 6 years ago

https://github.com/Netflix/eureka/blob/3a744ee88274e70324958bc996b33c29f16a872d/eureka-client/src/main/java/com/netflix/discovery/DiscoveryClient.java#L270

@Configuration
public class EurekaJerseyClientAdapter
{
    @Bean
    @ConditionalOnMissingBean
    public EurekaJerseyClient eurekaJerseyClient()
    {
        EurekaJerseyClientImpl.EurekaJerseyClientBuilder builder = new
        EurekaJerseyClientImpl.EurekaJerseyClientBuilder()
                .withClientName("server")
                .withMaxConnectionsPerHost(256)
                .withTrustStoreFile("client.truststore","123456");
        return builder.build();
    }
}

in my springboot project: com.itmuch.cloud.study com.itmuch.cloud.study.ConsumerMovieApplication com.itmuch.cloud.study.EurekaJerseyClientAdapter

i cont inject EurekaJerseyClient bean into DiscoveryClient.java#L270 so it used to init com.netflix.discovery.shared.transport.jersey.EurekaJerseyClientImpl.EurekaJerseyClientBuilder.MyDefaultApacheHttpClient4Config#createDefaultSslCM, but i dont want it.

qiangdavidliu commented 6 years ago

@YangGuang001 this seem more related to spring boot integration with eureka. Please try at https://github.com/spring-cloud/spring-cloud-netflix. Thanks.