sptz45 / sse-breaker Goto Github PK
View Code? Open in Web Editor NEWA circuit breaker implementation in Scala
License: Apache License 2.0
A circuit breaker implementation in Scala
License: Apache License 2.0
Should be done after JMX
I am trying to integrate your library into my project and it seems like the circuit is not tripping to open state properly.
My application is making requests every 4 seconds to a MongoDB database and I am shutting down the DB while the application is running. If a start the application when the DB is down the breaker is tripped into Open state when the failure counter reaches the maxFailures count, then I start up the DB again and the breaker is tripped into the Close state properly but if I shutdown the DB one more time the breaker is not tripping to the Open state anymore.
See below my code:
circuitBreaker match {
case Some(breaker) => {
breaker.failFast (fetchData(theQuery, filters, fetchMetaData))
.recover { case _: OpenCircuitException => {
Logger.error(Messages("circuitbreaker.open.circuit.error", dataProviderProperties.prettyPrint()))
Left(FailResult(Messages("circuitbreaker.open.circuit.error", dataProviderProperties.prettyPrint())))
}}
}
case _ => {
fetchData(theQuery, filters, fetchMetaData)
}
}
val failFast = new CircuitExecutor(
name="tweets-breaker",
CircuitConfiguration(
maxFailures = 5,
openCircuitTimeout = 30.seconds,
failureCountTimeout = 1.minute,
maxMethodDuration = 10.seconds)
)
Compile Error :
not enough arguments for constructor CircuitExecutor: (circuitName: String, circuitConfig: com.tzavellas.sse.breaker.CircuitConfiguration, circuitListener: com.tzavellas.sse.breaker.CircuitStateListener)com.tzavellas.sse.breaker.CircuitExecutor
This should be based on the sse-jmx project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.