Skip to content

Commit 03de237

Browse files
committed
Use last valid config in case of failed reload
1 parent 3ac8995 commit 03de237

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/com/hivemq/extensions/discovery/azure/client/AzureStorageClient.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ public void createOrUpdate() throws IllegalStateException, IllegalArgumentExcept
5555

5656
final AzureDiscoveryConfig newAzureDiscoveryConfig = configReader.readConfiguration();
5757
if (newAzureDiscoveryConfig == null) {
58-
throw new IllegalStateException("Configuration of the Azure Cluster Discovery Extension couldn't be loaded.");
58+
if (azureDiscoveryConfig != null) {
59+
log.warn("Configuration of the Azure Cluster Discovery Extension couldn't be loaded. Using last valid configuration.");
60+
}
61+
else {
62+
throw new IllegalStateException("Configuration of the Azure Cluster Discovery Extension couldn't be loaded.");
63+
}
64+
}
65+
else {
66+
azureDiscoveryConfig = newAzureDiscoveryConfig;
5967
}
60-
azureDiscoveryConfig = newAzureDiscoveryConfig;
6168

6269
final String connectionString = azureDiscoveryConfig.getConnectionString();
6370
final String containerName = azureDiscoveryConfig.getContainerName();

0 commit comments

Comments
 (0)