Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import javax.naming.directory.Attribute;
import javax.naming.directory.InitialDirContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
Expand All @@ -29,6 +31,8 @@
@Component
public class ReplicaLookUp {

private static final Logger LOGGER = LoggerFactory.getLogger(ReplicaLookUp.class);

private static final String ORIGIN_PREFIX = "dns:/_origin._tcp.";

private static final String REPLICA_PREFIX_ALT = "dns:/_alt";
Expand Down Expand Up @@ -63,7 +67,7 @@ public ReplicaLookUp(AppConfigurationProperties properties) throws NamingExcepti
public void updateAutoFailoverEndpoints() {
if (semaphore.tryAcquire()) {
for (ConfigStore configStore : properties.getStores()) {
if (!configStore.isEnabled()) {
if (!configStore.isEnabled() || !configStore.isReplicaDiscoveryEnabled()) {
continue;
}
String mainEndpoint = configStore.getEndpoint();
Expand All @@ -88,6 +92,7 @@ public void updateAutoFailoverEndpoints() {
records.put(mainEndpoint, srvRecords);
wait.put(mainEndpoint, Instant.now().plus(FALLBACK_CLIENT_REFRESH_EXPIRED_INTERVAL));
} catch (AppConfigurationReplicaException e) {
LOGGER.warn("Failed to finde replicas due to: " + e.getMessage());
wait.put(mainEndpoint, Instant.now().plus(MINIMAL_CLIENT_REFRESH_INTERVAL));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ spring.cloud.azure.appconfiguration.stores[0].selects[0].key-filter | The key pa
spring.cloud.azure.appconfiguration.stores[0].selects[0].label-filter | The label used to indicate which configuration(s) will be loaded. | No | `${spring.profiles.active}` or if null `\0`
spring.cloud.azure.appconfiguration.stores[0].selects[0].snapshot-name | The snapshot name used to indicate which configuration(s) will be loaded. | No | null
spring.cloud.azure.appconfiguration.stores[0].trim-key-prefix[0] | The prefix that will be trimmed from the key when the configuration is loaded. | No | null, unless using key-filter, then it is the key-filter
spring.cloud.azure.appconfiguration.stores[0].replicaDiscoveryEnabled | Enables periodic checking if new replicas of the store have been created. And found stores will be added to the bottom of the list of endpoints used in cases where the store can't be reached. | No | true

Configuration Store Authentication

Expand Down