Failsafe-Actuator

Failsafe-Actuator provides an out of the box endpoint for Failsafe

License

License

Categories

Categories

Failsafe Application Layer Libs Distributed Applications Failsafe Actuator Application Testing & Monitoring Monitoring
GroupId

GroupId

org.zalando
ArtifactId

ArtifactId

failsafe-actuator
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Failsafe-Actuator
Failsafe-Actuator provides an out of the box endpoint for Failsafe
Project URL

Project URL

https://github.com/zalando-incubator/failsafe-actuator
Project Organization

Project Organization

Zalando SE
Source Code Management

Source Code Management

https://github.com/zalando-incubator/failsafe-actuator

Download failsafe-actuator

How to add to project

<!-- https://jarcasting.com/artifacts/org.zalando/failsafe-actuator/ -->
<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>failsafe-actuator</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.zalando/failsafe-actuator/
implementation 'org.zalando:failsafe-actuator:1.0.0'
// https://jarcasting.com/artifacts/org.zalando/failsafe-actuator/
implementation ("org.zalando:failsafe-actuator:1.0.0")
'org.zalando:failsafe-actuator:jar:1.0.0'
<dependency org="org.zalando" name="failsafe-actuator" rev="1.0.0">
  <artifact name="failsafe-actuator" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.zalando', module='failsafe-actuator', version='1.0.0')
)
libraryDependencies += "org.zalando" % "failsafe-actuator" % "1.0.0"
[org.zalando/failsafe-actuator "1.0.0"]

Dependencies

compile (4)

Group / Artifact Type Version
net.jodah : failsafe jar 1.1.0
org.springframework.boot : spring-boot-actuator jar 2.0.3.RELEASE
org.springframework.boot : spring-boot-actuator-autoconfigure jar 2.0.3.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.0.3.RELEASE

provided (2)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 3.0.2
org.projectlombok : lombok jar 1.16.20

test (5)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar 2.0.3.RELEASE
org.springframework.boot : spring-boot-starter-web jar 2.0.3.RELEASE
junit : junit jar 4.12
com.jayway.jsonpath : json-path-assert jar 2.2.0
commons-io : commons-io jar 2.6

Project Modules

There are no modules declared in this project.

Codacy Badge Build Status Maven Central

Failsafe Actuator

Failsafe Actuator is a Java library that provides a simple monitoring interface for Spring Boot applications that use the Failsafe library. Using Failsafe Actuator will readily expose the state of your Circuit Breakers (closed, open, half-open) to your Spring Actuator endpoint without additional effort.

Core Technical Concepts/Inspiration

Failsafe Actuator supports Spring's dependency injection to make it easier to use Failsafe. It allows you to monitor the state of your Circuit Breakers so that, whenever a third party that your app relies upon suddenly becomes unavailable, you can discover it immediately and take action. This is essential for applications used in production.

Development Status/Project Roadmap

This library is currently under development and used in production at Zalando.

Find more details about our development plans in the Issues Tracker.

We're always looking for contributors, so if you find an interesting "Help Wanted" issue then please drop us a line in the related issue to claim it and begin working.

Unless you explicitly state otherwise in advance, any non trivial contribution intentionally submitted for inclusion in this project by you to the steward of this repository (Zalando SE, Berlin) shall be under the terms and conditions of the MIT License, without any additional copyright information, terms or conditions.

Getting Started

Dependencies/Requirements

Running/Using

To use Failsafe Actuator, add the following dependency to your project:

Gradle:

compile("org.zalando:failsafe-actuator:${FAILSAFE-ACTUATOR-VERSION}")

Maven:

<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>failsafe-actuator</artifactId>
    <version>${failsafe-actuator.version}</version>
</dependency>

Create your CircuitBreaker by defining them as a Bean.

@Configuration
public class CircuitBreakerConfiguration {
  @Bean
  public CircuitBreaker myBreaker() {
    return new CircuitBreaker();
  }
}

You can use and configure the created CircuitBreaker by autowiring it in the class where it should be used.

@Component
public class MyBean {
    @Autowired
    private CircuitBreaker myBreaker;
}

That's it. By calling the endpoint via http://${yourAddress}/actuator/circuit-breakers. you will get a response which looks like the following:

GET /actuator/circuit-breakers

HTTP/1.1 200
Content-Type: application/json

{
  "myBreaker": {
    "state": "OPEN"
  },
  "otherBreaker": {
    "state": "CLOSED"
  }
}

Individual circuit breakers can be requested via /acutuator/circuit-breakers/{name}:

GET /actuator/circuit-breakers/myBreaker

HTTP/1.1 200
Content-Type: application/json

{
  "state": "OPEN"
}

You can even modify the circuit breaker state and manually open or close them:

POST /actuator/circuit-breakers/myBreaker
Content-Type: application/json

{
  "state": "CLOSED"
}

Example usage

To see a complete example on how to use the library take a look at the Sample Application. It starts a Rest Controller that shows how to autowire CircuitBreaker into your application and configure them.

How to build on your own

In order to build the JAR on your own run the following command:

mvn clean install

License

This code is released under the MIT license. See License.

org.zalando

The Zalando Incubator

Projects in development at Zalando. We accept contributions and feedback—leave an issue at the relevant project's issues tracker.

Versions

Version
1.0.0
0.6.1-sb2
0.6.1
0.6.0
0.5.3
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1