/
EurekaClientConfigBean.java
1044 lines (869 loc) · 34.6 KB
/
EurekaClientConfigBean.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2013-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.netflix.eureka;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.netflix.appinfo.EurekaAccept;
import com.netflix.discovery.EurekaClientConfig;
import com.netflix.discovery.shared.transport.EurekaTransportConfig;
import org.apache.hc.client5.http.classic.HttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.core.Ordered;
import org.springframework.core.env.PropertyResolver;
import org.springframework.util.StringUtils;
import static org.springframework.cloud.netflix.eureka.EurekaConstants.DEFAULT_PREFIX;
/**
* Eureka client configuration bean.
*
* @author Dave Syer
* @author Gregor Zurowski
*/
@ConfigurationProperties(EurekaClientConfigBean.PREFIX)
public class EurekaClientConfigBean implements EurekaClientConfig, Ordered {
/**
* Default prefix for Eureka client config properties.
*/
public static final String PREFIX = "eureka.client";
/**
* Default Eureka URL.
*/
public static final String DEFAULT_URL = "http://localhost:8761" + DEFAULT_PREFIX + "/";
/**
* Default availability zone if none is resolved based on region.
*/
public static final String DEFAULT_ZONE = "defaultZone";
private static final int MINUTES = 60;
@Autowired(required = false)
PropertyResolver propertyResolver;
/**
* Flag to indicate that the Eureka client is enabled.
*/
private boolean enabled = true;
@NestedConfigurationProperty
private EurekaTransportConfig transport = new CloudEurekaTransportConfig();
/**
* Indicates how often(in seconds) to fetch the registry information from the eureka
* server.
*/
private int registryFetchIntervalSeconds = 30;
/**
* Indicates how often(in seconds) to replicate instance changes to be replicated to
* the eureka server.
*/
private int instanceInfoReplicationIntervalSeconds = 30;
/**
* Indicates how long initially (in seconds) to replicate instance info to the eureka
* server.
*/
private int initialInstanceInfoReplicationIntervalSeconds = 40;
/**
* Indicates how often(in seconds) to poll for changes to eureka server information.
* Eureka servers could be added or removed and this setting controls how soon the
* eureka clients should know about it.
*/
private int eurekaServiceUrlPollIntervalSeconds = 5 * MINUTES;
/**
* Gets the proxy port to eureka server if any.
*/
private String proxyPort;
/**
* Gets the proxy host to eureka server if any.
*/
private String proxyHost;
/**
* Gets the proxy user name if any.
*/
private String proxyUserName;
/**
* Gets the proxy password if any.
*/
private String proxyPassword;
/**
* Indicates how long to wait (in seconds) before a read from eureka server needs to
* timeout.
*/
private int eurekaServerReadTimeoutSeconds = 8;
/**
* Indicates how long to wait (in seconds) before a connection to eureka server needs
* to timeout. Note that the connections in the client are pooled by
* {@link HttpClient} and this setting affects the actual connection creation and also
* the wait time to get the connection from the pool.
*/
private int eurekaServerConnectTimeoutSeconds = 5;
/**
* Gets the name of the implementation which implements BackupRegistry to fetch the
* registry information as a fallback option for only the first time when the eureka
* client starts.
*
* This may be needed for applications which needs additional resiliency for registry
* information without which it cannot operate.
*/
private String backupRegistryImpl;
/**
* Gets the total number of connections that is allowed from eureka client to all
* eureka servers.
*/
private int eurekaServerTotalConnections = 200;
/**
* Gets the total number of connections that is allowed from eureka client to a eureka
* server host.
*/
private int eurekaServerTotalConnectionsPerHost = 50;
/**
* Gets the URL context to be used to construct the service url to contact eureka
* server when the list of eureka servers come from the DNS. This information is not
* required if the contract returns the service urls from eurekaServerServiceUrls.
*
* The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the
* eureka client expects the DNS to configured a certain way so that it can fetch
* changing eureka servers dynamically. The changes are effective at runtime.
*/
private String eurekaServerURLContext;
/**
* Gets the port to be used to construct the service url to contact eureka server when
* the list of eureka servers come from the DNS.This information is not required if
* the contract returns the service urls eurekaServerServiceUrls(String).
*
* The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the
* eureka client expects the DNS to configured a certain way so that it can fetch
* changing eureka servers dynamically.
*
* The changes are effective at runtime.
*/
private String eurekaServerPort;
/**
* Gets the DNS name to be queried to get the list of eureka servers.This information
* is not required if the contract returns the service urls by implementing
* serviceUrls.
*
* The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the
* eureka client expects the DNS to configured a certain way so that it can fetch
* changing eureka servers dynamically.
*
* The changes are effective at runtime.
*/
private String eurekaServerDNSName;
/**
* Gets the region (used in AWS datacenters) where this instance resides.
*/
private String region = "us-east-1";
/**
* Indicates how much time (in seconds) that the HTTP connections to eureka server can
* stay idle before it can be closed.
*
* In the AWS environment, it is recommended that the values is 30 seconds or less,
* since the firewall cleans up the connection information after a few mins leaving
* the connection hanging in limbo.
*/
private int eurekaConnectionIdleTimeoutSeconds = 30;
/**
* Indicates whether the client is only interested in the registry information for a
* single VIP.
*/
private String registryRefreshSingleVipAddress;
/**
* The thread pool size for the heartbeatExecutor to initialise with.
*/
private int heartbeatExecutorThreadPoolSize = 2;
/**
* Heartbeat executor exponential back off related property. It is a maximum
* multiplier value for retry delay, in case where a sequence of timeouts occurred.
*/
private int heartbeatExecutorExponentialBackOffBound = 10;
/**
* The thread pool size for the cacheRefreshExecutor to initialise with.
*/
private int cacheRefreshExecutorThreadPoolSize = 2;
/**
* Cache refresh executor exponential back off related property. It is a maximum
* multiplier value for retry delay, in case where a sequence of timeouts occurred.
*/
private int cacheRefreshExecutorExponentialBackOffBound = 10;
/**
* Map of availability zone to list of fully qualified URLs to communicate with eureka
* server. Each value can be a single URL or a comma separated list of alternative
* locations.
*
* Typically the eureka server URLs carry protocol,host,port,context and version
* information if any. Example:
* https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/
*
* The changes are effective at runtime at the next service url refresh cycle as
* specified by eurekaServiceUrlPollIntervalSeconds.
*/
private Map<String, String> serviceUrl = new HashMap<>();
{
this.serviceUrl.put(DEFAULT_ZONE, DEFAULT_URL);
}
/**
* Indicates whether the content fetched from eureka server has to be compressed
* whenever it is supported by the server. The registry information from the eureka
* server is compressed for optimum network traffic.
*/
private boolean gZipContent = true;
/**
* Indicates whether the eureka client should use the DNS mechanism to fetch a list of
* eureka servers to talk to. When the DNS name is updated to have additional servers,
* that information is used immediately after the eureka client polls for that
* information as specified in eurekaServiceUrlPollIntervalSeconds.
*
* Alternatively, the service urls can be returned serviceUrls, but the users should
* implement their own mechanism to return the updated list in case of changes.
*
* The changes are effective at runtime.
*/
private boolean useDnsForFetchingServiceUrls = false;
/**
* Indicates whether or not this instance should register its information with eureka
* server for discovery by others.
*
* In some cases, you do not want your instances to be discovered whereas you just
* want do discover other instances.
*/
private boolean registerWithEureka = true;
/**
* Indicates whether or not this instance should try to use the eureka server in the
* same zone for latency and/or other reason.
*
* Ideally eureka clients are configured to talk to servers in the same zone
*
* The changes are effective at runtime at the next registry fetch cycle as specified
* by registryFetchIntervalSeconds
*/
private boolean preferSameZoneEureka = true;
/**
* Indicates whether to log differences between the eureka server and the eureka
* client in terms of registry information.
*
* Eureka client tries to retrieve only delta changes from eureka server to minimize
* network traffic. After receiving the deltas, eureka client reconciles the
* information from the server to verify it has not missed out some information.
* Reconciliation failures could happen when the client has had network issues
* communicating to server.If the reconciliation fails, eureka client gets the full
* registry information.
*
* While getting the full registry information, the eureka client can log the
* differences between the client and the server and this setting controls that.
*
* The changes are effective at runtime at the next registry fetch cycle as specified
* by registryFetchIntervalSecondsr
*/
private boolean logDeltaDiff;
/**
* Indicates whether the eureka client should disable fetching of delta and should
* rather resort to getting the full registry information.
*
* Note that the delta fetches can reduce the traffic tremendously, because the rate
* of change with the eureka server is normally much lower than the rate of fetches.
*
* The changes are effective at runtime at the next registry fetch cycle as specified
* by registryFetchIntervalSeconds
*/
private boolean disableDelta;
/**
* Comma separated list of regions for which the eureka registry information will be
* fetched. It is mandatory to define the availability zones for each of these regions
* as returned by availabilityZones. Failing to do so, will result in failure of
* discovery client startup.
*
*/
private String fetchRemoteRegionsRegistry;
/**
* Gets the list of availability zones (used in AWS data centers) for the region in
* which this instance resides.
*
* The changes are effective at runtime at the next registry fetch cycle as specified
* by registryFetchIntervalSeconds.
*/
private Map<String, String> availabilityZones = new HashMap<>();
/**
* Indicates whether to get the applications after filtering the applications for
* instances with only InstanceStatus UP states.
*/
private boolean filterOnlyUpInstances = true;
/**
* Indicates whether this client should fetch eureka registry information from eureka
* server.
*/
private boolean fetchRegistry = true;
/**
* Get a replacement string for Dollar sign <code>$</code> during
* serializing/deserializing information in eureka server.
*/
private String dollarReplacement = "_-";
/**
* Get a replacement string for underscore sign <code>_</code> during serializing/
* deserializing information in eureka server.
*/
private String escapeCharReplacement = "__";
/**
* Indicates whether server can redirect a client request to a backup server/cluster.
* If set to false, the server will handle the request directly, If set to true, it
* may send HTTP redirect to the client, with a new server location.
*/
private boolean allowRedirects = false;
/**
* If set to true, local status updates via ApplicationInfoManager will trigger
* on-demand (but rate limited) register/updates to remote eureka servers.
*/
private boolean onDemandUpdateStatusChange = true;
/**
* This is a transient config and once the latest codecs are stable, can be removed
* (as there will only be one).
*/
private String encoderName;
/**
* This is a transient config and once the latest codecs are stable, can be removed
* (as there will only be one).
*/
private String decoderName;
/**
* EurekaAccept name for client data accept.
*/
private String clientDataAccept = EurekaAccept.full.name();
/**
* Indicates whether the client should explicitly unregister itself from the remote
* server on client shutdown.
*/
private boolean shouldUnregisterOnShutdown = true;
/**
* Indicates whether the client should enforce registration during initialization.
* Defaults to false.
*/
private boolean shouldEnforceRegistrationAtInit = false;
/**
* Order of the discovery client used by `CompositeDiscoveryClient` for sorting
* available clients.
*/
private int order = 0;
@Override
public boolean shouldGZipContent() {
return this.gZipContent;
}
@Override
public boolean shouldUseDnsForFetchingServiceUrls() {
return this.useDnsForFetchingServiceUrls;
}
@Override
public boolean shouldRegisterWithEureka() {
return this.registerWithEureka;
}
@Override
public boolean shouldPreferSameZoneEureka() {
return this.preferSameZoneEureka;
}
@Override
public boolean shouldLogDeltaDiff() {
return this.logDeltaDiff;
}
@Override
public boolean shouldDisableDelta() {
return this.disableDelta;
}
@Override
public boolean shouldUnregisterOnShutdown() {
return this.shouldUnregisterOnShutdown;
}
@Override
public boolean shouldEnforceRegistrationAtInit() {
return this.shouldEnforceRegistrationAtInit;
}
@Override
public String fetchRegistryForRemoteRegions() {
return this.fetchRemoteRegionsRegistry;
}
@Override
public String[] getAvailabilityZones(String region) {
String value = this.availabilityZones.get(region);
if (value == null) {
value = DEFAULT_ZONE;
}
return value.split(",");
}
@Override
public List<String> getEurekaServerServiceUrls(String myZone) {
String serviceUrls = this.serviceUrl.get(myZone);
if (serviceUrls == null || serviceUrls.isEmpty()) {
serviceUrls = this.serviceUrl.get(DEFAULT_ZONE);
}
if (StringUtils.hasText(serviceUrls)) {
final String[] serviceUrlsSplit = StringUtils.commaDelimitedListToStringArray(serviceUrls);
List<String> eurekaServiceUrls = new ArrayList<>(serviceUrlsSplit.length);
for (String eurekaServiceUrl : serviceUrlsSplit) {
if (!endsWithSlash(eurekaServiceUrl)) {
eurekaServiceUrl += "/";
}
eurekaServiceUrls.add(eurekaServiceUrl.trim());
}
return eurekaServiceUrls;
}
return new ArrayList<>();
}
private boolean endsWithSlash(String url) {
return url.endsWith("/");
}
@Override
public boolean shouldFilterOnlyUpInstances() {
return this.filterOnlyUpInstances;
}
@Override
public boolean shouldFetchRegistry() {
return this.fetchRegistry;
}
@Override
public boolean allowRedirects() {
return this.allowRedirects;
}
@Override
public boolean shouldOnDemandUpdateStatusChange() {
return this.onDemandUpdateStatusChange;
}
@Override
public String getExperimental(String name) {
if (this.propertyResolver != null) {
return this.propertyResolver.getProperty(PREFIX + ".experimental." + name, String.class, null);
}
return null;
}
@Override
public EurekaTransportConfig getTransportConfig() {
return getTransport();
}
public PropertyResolver getPropertyResolver() {
return propertyResolver;
}
public void setPropertyResolver(PropertyResolver propertyResolver) {
this.propertyResolver = propertyResolver;
}
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public EurekaTransportConfig getTransport() {
return transport;
}
public void setTransport(EurekaTransportConfig transport) {
this.transport = transport;
}
@Override
public int getRegistryFetchIntervalSeconds() {
return registryFetchIntervalSeconds;
}
public void setRegistryFetchIntervalSeconds(int registryFetchIntervalSeconds) {
this.registryFetchIntervalSeconds = registryFetchIntervalSeconds;
}
@Override
public int getInstanceInfoReplicationIntervalSeconds() {
return instanceInfoReplicationIntervalSeconds;
}
public void setInstanceInfoReplicationIntervalSeconds(int instanceInfoReplicationIntervalSeconds) {
this.instanceInfoReplicationIntervalSeconds = instanceInfoReplicationIntervalSeconds;
}
@Override
public int getInitialInstanceInfoReplicationIntervalSeconds() {
return initialInstanceInfoReplicationIntervalSeconds;
}
public void setInitialInstanceInfoReplicationIntervalSeconds(int initialInstanceInfoReplicationIntervalSeconds) {
this.initialInstanceInfoReplicationIntervalSeconds = initialInstanceInfoReplicationIntervalSeconds;
}
@Override
public int getEurekaServiceUrlPollIntervalSeconds() {
return eurekaServiceUrlPollIntervalSeconds;
}
public void setEurekaServiceUrlPollIntervalSeconds(int eurekaServiceUrlPollIntervalSeconds) {
this.eurekaServiceUrlPollIntervalSeconds = eurekaServiceUrlPollIntervalSeconds;
}
@Override
public String getProxyPort() {
return proxyPort;
}
public void setProxyPort(String proxyPort) {
this.proxyPort = proxyPort;
}
@Override
public String getProxyHost() {
return proxyHost;
}
public void setProxyHost(String proxyHost) {
this.proxyHost = proxyHost;
}
@Override
public String getProxyUserName() {
return proxyUserName;
}
public void setProxyUserName(String proxyUserName) {
this.proxyUserName = proxyUserName;
}
@Override
public String getProxyPassword() {
return proxyPassword;
}
public void setProxyPassword(String proxyPassword) {
this.proxyPassword = proxyPassword;
}
@Override
public int getEurekaServerReadTimeoutSeconds() {
return eurekaServerReadTimeoutSeconds;
}
public void setEurekaServerReadTimeoutSeconds(int eurekaServerReadTimeoutSeconds) {
this.eurekaServerReadTimeoutSeconds = eurekaServerReadTimeoutSeconds;
}
@Override
public int getEurekaServerConnectTimeoutSeconds() {
return eurekaServerConnectTimeoutSeconds;
}
public void setEurekaServerConnectTimeoutSeconds(int eurekaServerConnectTimeoutSeconds) {
this.eurekaServerConnectTimeoutSeconds = eurekaServerConnectTimeoutSeconds;
}
@Override
public String getBackupRegistryImpl() {
return backupRegistryImpl;
}
public void setBackupRegistryImpl(String backupRegistryImpl) {
this.backupRegistryImpl = backupRegistryImpl;
}
@Override
public int getEurekaServerTotalConnections() {
return eurekaServerTotalConnections;
}
public void setEurekaServerTotalConnections(int eurekaServerTotalConnections) {
this.eurekaServerTotalConnections = eurekaServerTotalConnections;
}
@Override
public int getEurekaServerTotalConnectionsPerHost() {
return eurekaServerTotalConnectionsPerHost;
}
public void setEurekaServerTotalConnectionsPerHost(int eurekaServerTotalConnectionsPerHost) {
this.eurekaServerTotalConnectionsPerHost = eurekaServerTotalConnectionsPerHost;
}
@Override
public String getEurekaServerURLContext() {
return eurekaServerURLContext;
}
public void setEurekaServerURLContext(String eurekaServerURLContext) {
this.eurekaServerURLContext = eurekaServerURLContext;
}
@Override
public String getEurekaServerPort() {
return eurekaServerPort;
}
public void setEurekaServerPort(String eurekaServerPort) {
this.eurekaServerPort = eurekaServerPort;
}
@Override
public String getEurekaServerDNSName() {
return eurekaServerDNSName;
}
public void setEurekaServerDNSName(String eurekaServerDNSName) {
this.eurekaServerDNSName = eurekaServerDNSName;
}
@Override
public String getRegion() {
return region;
}
public void setRegion(String region) {
this.region = region;
}
@Override
public int getEurekaConnectionIdleTimeoutSeconds() {
return eurekaConnectionIdleTimeoutSeconds;
}
public void setEurekaConnectionIdleTimeoutSeconds(int eurekaConnectionIdleTimeoutSeconds) {
this.eurekaConnectionIdleTimeoutSeconds = eurekaConnectionIdleTimeoutSeconds;
}
@Override
public String getRegistryRefreshSingleVipAddress() {
return registryRefreshSingleVipAddress;
}
public void setRegistryRefreshSingleVipAddress(String registryRefreshSingleVipAddress) {
this.registryRefreshSingleVipAddress = registryRefreshSingleVipAddress;
}
@Override
public int getHeartbeatExecutorThreadPoolSize() {
return heartbeatExecutorThreadPoolSize;
}
public void setHeartbeatExecutorThreadPoolSize(int heartbeatExecutorThreadPoolSize) {
this.heartbeatExecutorThreadPoolSize = heartbeatExecutorThreadPoolSize;
}
@Override
public int getHeartbeatExecutorExponentialBackOffBound() {
return heartbeatExecutorExponentialBackOffBound;
}
public void setHeartbeatExecutorExponentialBackOffBound(int heartbeatExecutorExponentialBackOffBound) {
this.heartbeatExecutorExponentialBackOffBound = heartbeatExecutorExponentialBackOffBound;
}
@Override
public int getCacheRefreshExecutorThreadPoolSize() {
return cacheRefreshExecutorThreadPoolSize;
}
public void setCacheRefreshExecutorThreadPoolSize(int cacheRefreshExecutorThreadPoolSize) {
this.cacheRefreshExecutorThreadPoolSize = cacheRefreshExecutorThreadPoolSize;
}
@Override
public int getCacheRefreshExecutorExponentialBackOffBound() {
return cacheRefreshExecutorExponentialBackOffBound;
}
public void setCacheRefreshExecutorExponentialBackOffBound(int cacheRefreshExecutorExponentialBackOffBound) {
this.cacheRefreshExecutorExponentialBackOffBound = cacheRefreshExecutorExponentialBackOffBound;
}
public Map<String, String> getServiceUrl() {
return serviceUrl;
}
public void setServiceUrl(Map<String, String> serviceUrl) {
this.serviceUrl = serviceUrl;
}
public boolean isgZipContent() {
return gZipContent;
}
public void setgZipContent(boolean gZipContent) {
this.gZipContent = gZipContent;
}
public boolean isUseDnsForFetchingServiceUrls() {
return useDnsForFetchingServiceUrls;
}
public void setUseDnsForFetchingServiceUrls(boolean useDnsForFetchingServiceUrls) {
this.useDnsForFetchingServiceUrls = useDnsForFetchingServiceUrls;
}
public boolean isRegisterWithEureka() {
return registerWithEureka;
}
public void setRegisterWithEureka(boolean registerWithEureka) {
this.registerWithEureka = registerWithEureka;
}
public boolean isPreferSameZoneEureka() {
return preferSameZoneEureka;
}
public void setPreferSameZoneEureka(boolean preferSameZoneEureka) {
this.preferSameZoneEureka = preferSameZoneEureka;
}
public boolean isLogDeltaDiff() {
return logDeltaDiff;
}
public void setLogDeltaDiff(boolean logDeltaDiff) {
this.logDeltaDiff = logDeltaDiff;
}
public boolean isDisableDelta() {
return disableDelta;
}
public void setDisableDelta(boolean disableDelta) {
this.disableDelta = disableDelta;
}
public String getFetchRemoteRegionsRegistry() {
return fetchRemoteRegionsRegistry;
}
public void setFetchRemoteRegionsRegistry(String fetchRemoteRegionsRegistry) {
this.fetchRemoteRegionsRegistry = fetchRemoteRegionsRegistry;
}
public Map<String, String> getAvailabilityZones() {
return availabilityZones;
}
public void setAvailabilityZones(Map<String, String> availabilityZones) {
this.availabilityZones = availabilityZones;
}
public boolean isFilterOnlyUpInstances() {
return filterOnlyUpInstances;
}
public void setFilterOnlyUpInstances(boolean filterOnlyUpInstances) {
this.filterOnlyUpInstances = filterOnlyUpInstances;
}
public boolean isFetchRegistry() {
return fetchRegistry;
}
public void setFetchRegistry(boolean fetchRegistry) {
this.fetchRegistry = fetchRegistry;
}
@Override
public String getDollarReplacement() {
return dollarReplacement;
}
public void setDollarReplacement(String dollarReplacement) {
this.dollarReplacement = dollarReplacement;
}
@Override
public String getEscapeCharReplacement() {
return escapeCharReplacement;
}
public void setEscapeCharReplacement(String escapeCharReplacement) {
this.escapeCharReplacement = escapeCharReplacement;
}
public boolean isAllowRedirects() {
return allowRedirects;
}
public void setAllowRedirects(boolean allowRedirects) {
this.allowRedirects = allowRedirects;
}
public boolean isOnDemandUpdateStatusChange() {
return onDemandUpdateStatusChange;
}
public void setOnDemandUpdateStatusChange(boolean onDemandUpdateStatusChange) {
this.onDemandUpdateStatusChange = onDemandUpdateStatusChange;
}
@Override
public String getEncoderName() {
return encoderName;
}
public void setEncoderName(String encoderName) {
this.encoderName = encoderName;
}
@Override
public String getDecoderName() {
return decoderName;
}
public void setDecoderName(String decoderName) {
this.decoderName = decoderName;
}
@Override
public String getClientDataAccept() {
return clientDataAccept;
}
public void setClientDataAccept(String clientDataAccept) {
this.clientDataAccept = clientDataAccept;
}
public boolean isShouldUnregisterOnShutdown() {
return shouldUnregisterOnShutdown;
}
public void setShouldUnregisterOnShutdown(boolean shouldUnregisterOnShutdown) {
this.shouldUnregisterOnShutdown = shouldUnregisterOnShutdown;
}
public boolean isShouldEnforceRegistrationAtInit() {
return shouldEnforceRegistrationAtInit;
}
public void setShouldEnforceRegistrationAtInit(boolean shouldEnforceRegistrationAtInit) {
this.shouldEnforceRegistrationAtInit = shouldEnforceRegistrationAtInit;
}
@Override
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EurekaClientConfigBean that = (EurekaClientConfigBean) o;
return Objects.equals(propertyResolver, that.propertyResolver) && enabled == that.enabled
&& Objects.equals(transport, that.transport)
&& registryFetchIntervalSeconds == that.registryFetchIntervalSeconds
&& instanceInfoReplicationIntervalSeconds == that.instanceInfoReplicationIntervalSeconds
&& initialInstanceInfoReplicationIntervalSeconds == that.initialInstanceInfoReplicationIntervalSeconds
&& eurekaServiceUrlPollIntervalSeconds == that.eurekaServiceUrlPollIntervalSeconds
&& eurekaServerReadTimeoutSeconds == that.eurekaServerReadTimeoutSeconds
&& eurekaServerConnectTimeoutSeconds == that.eurekaServerConnectTimeoutSeconds
&& eurekaServerTotalConnections == that.eurekaServerTotalConnections
&& eurekaServerTotalConnectionsPerHost == that.eurekaServerTotalConnectionsPerHost
&& eurekaConnectionIdleTimeoutSeconds == that.eurekaConnectionIdleTimeoutSeconds
&& heartbeatExecutorThreadPoolSize == that.heartbeatExecutorThreadPoolSize
&& heartbeatExecutorExponentialBackOffBound == that.heartbeatExecutorExponentialBackOffBound
&& cacheRefreshExecutorThreadPoolSize == that.cacheRefreshExecutorThreadPoolSize
&& cacheRefreshExecutorExponentialBackOffBound == that.cacheRefreshExecutorExponentialBackOffBound
&& gZipContent == that.gZipContent && useDnsForFetchingServiceUrls == that.useDnsForFetchingServiceUrls
&& registerWithEureka == that.registerWithEureka && preferSameZoneEureka == that.preferSameZoneEureka
&& logDeltaDiff == that.logDeltaDiff && disableDelta == that.disableDelta
&& filterOnlyUpInstances == that.filterOnlyUpInstances && fetchRegistry == that.fetchRegistry
&& allowRedirects == that.allowRedirects
&& onDemandUpdateStatusChange == that.onDemandUpdateStatusChange
&& shouldUnregisterOnShutdown == that.shouldUnregisterOnShutdown
&& shouldEnforceRegistrationAtInit == that.shouldEnforceRegistrationAtInit
&& Objects.equals(proxyPort, that.proxyPort) && Objects.equals(proxyHost, that.proxyHost)
&& Objects.equals(proxyUserName, that.proxyUserName)
&& Objects.equals(proxyPassword, that.proxyPassword)
&& Objects.equals(backupRegistryImpl, that.backupRegistryImpl)
&& Objects.equals(eurekaServerURLContext, that.eurekaServerURLContext)
&& Objects.equals(eurekaServerPort, that.eurekaServerPort)
&& Objects.equals(eurekaServerDNSName, that.eurekaServerDNSName) && Objects.equals(region, that.region)
&& Objects.equals(registryRefreshSingleVipAddress, that.registryRefreshSingleVipAddress)
&& Objects.equals(serviceUrl, that.serviceUrl)
&& Objects.equals(fetchRemoteRegionsRegistry, that.fetchRemoteRegionsRegistry)
&& Objects.equals(availabilityZones, that.availabilityZones)
&& Objects.equals(dollarReplacement, that.dollarReplacement)
&& Objects.equals(escapeCharReplacement, that.escapeCharReplacement)
&& Objects.equals(encoderName, that.encoderName) && Objects.equals(decoderName, that.decoderName)
&& Objects.equals(clientDataAccept, that.clientDataAccept) && Objects.equals(order, that.order);
}
@Override
public int hashCode() {
return Objects.hash(propertyResolver, enabled, transport, registryFetchIntervalSeconds,
instanceInfoReplicationIntervalSeconds, initialInstanceInfoReplicationIntervalSeconds,
eurekaServiceUrlPollIntervalSeconds, proxyPort, proxyHost, proxyUserName, proxyPassword,
eurekaServerReadTimeoutSeconds, eurekaServerConnectTimeoutSeconds, backupRegistryImpl,
eurekaServerTotalConnections, eurekaServerTotalConnectionsPerHost, eurekaServerURLContext,
eurekaServerPort, eurekaServerDNSName, region, eurekaConnectionIdleTimeoutSeconds,
registryRefreshSingleVipAddress, heartbeatExecutorThreadPoolSize,
heartbeatExecutorExponentialBackOffBound, cacheRefreshExecutorThreadPoolSize,
cacheRefreshExecutorExponentialBackOffBound, serviceUrl, gZipContent, useDnsForFetchingServiceUrls,
registerWithEureka, preferSameZoneEureka, logDeltaDiff, disableDelta, fetchRemoteRegionsRegistry,
availabilityZones, filterOnlyUpInstances, fetchRegistry, dollarReplacement, escapeCharReplacement,
allowRedirects, onDemandUpdateStatusChange, encoderName, decoderName, clientDataAccept,
shouldUnregisterOnShutdown, shouldEnforceRegistrationAtInit, order);
}
@Override
public String toString() {