-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1473 from spencergibb/fixme-2-0-patch1
Fixme 2.0 patch1. LGTM
- Loading branch information
Showing
34 changed files
with
330 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...sey3/src/main/java/com/netflix/eureka/transport/Jersey3EurekaServerHttpClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.netflix.eureka.transport; | ||
|
||
import com.netflix.discovery.shared.dns.DnsServiceImpl; | ||
import com.netflix.discovery.shared.resolver.ClusterResolver; | ||
import com.netflix.discovery.shared.resolver.EurekaEndpoint; | ||
import com.netflix.discovery.shared.transport.EurekaHttpClient; | ||
import com.netflix.discovery.shared.transport.EurekaTransportConfig; | ||
import com.netflix.discovery.shared.transport.TransportClientFactory; | ||
import com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient; | ||
import com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient; | ||
import com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient; | ||
import com.netflix.discovery.shared.transport.decorator.ServerStatusEvaluators; | ||
import com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient; | ||
import com.netflix.eureka.EurekaServerConfig; | ||
import com.netflix.eureka.Names; | ||
import com.netflix.eureka.resources.ServerCodecs; | ||
|
||
public class Jersey3EurekaServerHttpClientFactory implements EurekaServerHttpClientFactory { | ||
|
||
public static final long RECONNECT_INTERVAL_MINUTES = 30; | ||
|
||
@Override | ||
public EurekaHttpClient createRemoteRegionClient(EurekaServerConfig serverConfig, EurekaTransportConfig transportConfig, ServerCodecs serverCodecs, ClusterResolver<EurekaEndpoint> clusterResolver) { | ||
Jersey3RemoteRegionClientFactory jersey3RemoteRegionClientFactory = new Jersey3RemoteRegionClientFactory(serverConfig, serverCodecs, clusterResolver.getRegion()); | ||
TransportClientFactory metricsFactory = MetricsCollectingEurekaHttpClient.createFactory(jersey3RemoteRegionClientFactory); | ||
|
||
SessionedEurekaHttpClient client = new SessionedEurekaHttpClient( | ||
Names.REMOTE, | ||
RetryableEurekaHttpClient.createFactory( | ||
Names.REMOTE, | ||
transportConfig, | ||
clusterResolver, | ||
createFactory(metricsFactory), | ||
ServerStatusEvaluators.legacyEvaluator()), | ||
RECONNECT_INTERVAL_MINUTES * 60 * 1000 | ||
); | ||
return client; | ||
} | ||
|
||
public static TransportClientFactory createFactory(final TransportClientFactory delegateFactory) { | ||
final DnsServiceImpl dnsService = new DnsServiceImpl(); | ||
return new TransportClientFactory() { | ||
@Override | ||
public EurekaHttpClient newClient(EurekaEndpoint endpoint) { | ||
return new RedirectingEurekaHttpClient(endpoint.getServiceUrl(), delegateFactory, dnsService); | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
delegateFactory.shutdown(); | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.