Skip to content

Commit

Permalink
[#4676] optimized the method of building ServiceCenterClient
Browse files Browse the repository at this point in the history
  • Loading branch information
chengyouling committed Jan 15, 2025
1 parent 0668f63 commit bc964da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ public class ServiceCenterClient implements ServiceCenterOperation {

private EventBus eventBus;

private ServiceCenterAddressManager addressManager;
private final ServiceCenterAddressManager addressManager;

public ServiceCenterClient(ServiceCenterRawClient httpClient) {
public ServiceCenterClient(ServiceCenterRawClient httpClient, ServiceCenterAddressManager addressManager) {
this.httpClient = httpClient;
this.addressManager = addressManager;
}

public ServiceCenterClient setEventBus(EventBus eventBus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static ServiceCenterClient serviceCenterClient(SCConfigurationProperties
return new ServiceCenterClient(new ServiceCenterRawClient.Builder()
.setTenantName("default")
.setAddressManager(addressManager)
.setHttpTransport(createHttpTransport(environment, sslProperties)).build());
.setHttpTransport(createHttpTransport(environment, sslProperties)).build(), addressManager);
}

private static HttpTransport createHttpTransport(Environment environment, SSLProperties sslProperties) {
Expand Down

0 comments on commit bc964da

Please sign in to comment.