-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Canary Rate Threshold Circuit Breaker Strategy: All circuits open at …
…start (#588) * implementing circuit breaker factory * fixmes * testing * testing * setup strategy mapping * fixing validation * must call hotload method once * adjusting logs * add server address as circuit breaker name * fixing compiling errors * refactoring * refactoring * fixing test * fixing test * fixing test * fixing test * fixing test * fixing test * fixing test * messages formatting and refactoring * refactoring * disabling metrics * heating circuit breakers at app startup * todos * adjusts * adjusts * fixing tests * fixing tests * fixing tests * testing * item tick * clearing todos * [Gradle Release Plugin] - new version commit: '3.31.1-snapshot'. * release notes
- Loading branch information
Showing
28 changed files
with
346 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version=3.31.0-snapshot | ||
version=3.31.1-snapshot |
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
40 changes: 40 additions & 0 deletions
40
...geddo/dnsproxyserver/solver/remote/circuitbreaker/application/DnsServerHealthChecker.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,40 @@ | ||
package com.mageddo.dnsproxyserver.solver.remote.circuitbreaker.application; | ||
|
||
import com.mageddo.dns.utils.Messages; | ||
import com.mageddo.dnsproxyserver.solver.SimpleResolver; | ||
import com.mageddo.net.IpAddr; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.ClassUtils; | ||
|
||
import java.io.IOException; | ||
|
||
@Slf4j | ||
public class DnsServerHealthChecker implements HealthChecker { | ||
|
||
private final SimpleResolver resolver; | ||
|
||
public DnsServerHealthChecker(IpAddr addr) { | ||
this.resolver = new SimpleResolver(addr); | ||
} | ||
|
||
@Override | ||
public boolean isHealthy() { | ||
final var req = Messages.aQuestion("dps.dns.test"); | ||
try { | ||
final var res = this.resolver.send(req); | ||
log.debug("status=done, server={}, res={}", this.resolver.getAddress(), Messages.simplePrint(res)); | ||
return Messages.findQuestionTypeCode(res) != null; | ||
} catch (IOException e) { | ||
log.debug( | ||
"status=failed, server={}, res={}, clazz={}", | ||
this.resolver.getAddress(), e.getMessage(), ClassUtils.getSimpleName(e) | ||
); | ||
return false; | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(this.resolver.getAddress()); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../mageddo/dnsproxyserver/solver/remote/circuitbreaker/application/HealthCheckerStatic.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,15 @@ | ||
package com.mageddo.dnsproxyserver.solver.remote.circuitbreaker.application; | ||
|
||
public class HealthCheckerStatic implements HealthChecker { | ||
|
||
private final boolean healthy; | ||
|
||
public HealthCheckerStatic(boolean healthy) { | ||
this.healthy = healthy; | ||
} | ||
|
||
@Override | ||
public boolean isHealthy() { | ||
return this.healthy; | ||
} | ||
} |
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
Oops, something went wrong.