Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Add circuit breaker #173

Merged
merged 1 commit into from
Jul 15, 2016
Merged

Add circuit breaker #173

merged 1 commit into from
Jul 15, 2016

Conversation

danpersa
Copy link
Contributor

No description provided.

@danpersa
Copy link
Contributor Author

The circuit breaker is created by the provider each time it is requested.
So we have a CircuitBreaker for each of the clients.

On Thu, Jul 14, 2016 at 4:47 PM, Robert Biter notifications@github.com
wrote:

Shouldn't there be a different circuit breaker for different services? If
the team service is down, some of the endpoints in innkeeper should still
be usable.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#173 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAjWVrWMnGhsPoamWQdLH-PUQMID1gsdks5qVkwTgaJpZM4JMdZZ
.

@NorthFury
Copy link
Member

👍

.withFailureThreshold(3, 5)
.withSuccessThreshold(3)
.withDelay(30L, TimeUnit.SECONDS)
breaker.open()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to overcome this: failsafe-lib/failsafe#34


/**
* @author dpersa
*/
class UtilsModule extends AbstractModule with ScalaModule {

override def configure() = {
bind[DefaultAsyncHttpClient].toProvider[AsyncClientProvider].asEagerSingleton()
bind[CircuitBreaker].toProvider[CircuitBreakerProvider]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one shouldn't be singleton :)

@NorthFury
Copy link
Member

👍

@danpersa danpersa merged commit cc12e82 into master Jul 15, 2016
@danpersa danpersa deleted the circuit-breaker branch July 15, 2016 09:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants