ESA ServiceKeeper is a lightweight service governance framework.

Overview

ServiceKeeper

Build codecov Maven Central GitHub license

ServiceKeeper is a lightweight service governance framework that provides many awesome features such as rate limit, concurrent limit, circuit breaker, retry and fallback... You can get start and customize the configuration easily with annotation.

Features

  • Concurrent Limit
  • Rate Limit
  • Circuit Breaker
  • Fallback
  • Manual fallback
  • Parameter-level concurrent limit, circuit breaker and such on

Quick Start

Step one: Add maven dependency

<dependency>
    <groupId>io.esastack</groupId>
    <artifactId>servicekeeper-springboot-adapter</artifactId>
    <version>${servicekeeper.version}</version>
</dependency>

Step two: Add customize configuration by annotation

@SpringBootApplication
public class AppMain {

    @Bean
    public HelloService helloService() {
        return new HelloService();
    }

    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(AppMain.class);

        final HelloService service = ctx.getBean(HelloService.class);
        int errorCount = 0;
        for (int i = 0 ; i < 20; i++) {
            try {
                service.hello();
            } catch (RateLimitOverFlowException ex) {
                errorCount++;
            }
        }

        System.out.println("RateLimitOverFlowException count: " + errorCount);
        ctx.close();
    }

    public class HelloService {

        @RateLimiter(limitForPeriod = 10)
        public String hello() {
            return "Hello World!";
        }

    }
}

See more details in Reference Doc

Comments
  • migrate internal changes to github

    migrate internal changes to github

    • fix failed to log timing independently
    • optimize redundant log
    • disable configurators in DefaultServiceKeeperAopTest when setup
    • fix the execution failure of SyncExecutableTest#testCircuitBreakerBySpendTime caused by thread.sleep()'s insufficient precision
    enhancement 
    opened by LCDZhao-Z 0
  • Simplify the attributes in the annotation

    Simplify the attributes in the annotation

    Expect

    @RateLimiter(10)
    @ConcurrentLimiter(10)
    public String hello() {
    
    }
    

    Actual

    @RateLimiter(limitForPeriod = 10)
    @ConcurrentLimiter(threshold = 10)
    public String hello() {
    
    }
    

    As shown above, the attribute limitForPeriod and threshold are redundant.

    enhancement 
    opened by Mkabaka 0
  • PredicateConfig of different arg value is wanted

    PredicateConfig of different arg value is wanted

    I want to add arg's circuit-breaker config as:

    demoMethod.arg0.maxSpendTimeMs={LiMing: 20, WangWu: 30}
    

    As shown above, I want to set the different config for different arg values, but now it's unsupported.

    enhancement 
    opened by Mkabaka 0
  • Support PredicateStrategyConfig when custom PredicateStrategy

    Support PredicateStrategyConfig when custom PredicateStrategy

    There is no way to get the PredicateStrategyConfig when I want to custom PredicateStrategy, and generally speaking, those options are necessary for me.

    enhancement 
    opened by Mkabaka 0
  • reduce the unnecessary calls of toString () for method args

    reduce the unnecessary calls of toString () for method args

    Current Behaviour

    To get the config of arg,servicekeeper will call toString() of the arg value to generate argResourceId whether the arg has configs or not. It leads to a large number of unnecessary calls of toString(), resulting in unnecessary performance consumption.

    Expected

    Effect

    Servicekeeper calls toString() of the arg value to generate argResourceId only when the arg has configs.

    Implementation

    Servicekeeper determines whether an arg config belongs to a method through the prefix of the arg config, packages the method config and arg configs of the same method into an object, and stores it with the method id as the key.

    Servicekeeper obtains the method config and arg configs of the method through the method id, and then determines whether to call toString() on its arg value to generate argResourceId by checking whether the arg itself has configs.

    enhancement 
    opened by LCDZhao-Z 0
Releases(v0.1.0)
  • v0.1.0(Sep 22, 2021)

Owner
ESA Stack
Elastic Service Architecture
ESA Stack
Lattice is a powerful, lightweight business extension invoke framework. By using the Lattice framework, complex business customization can be efficiently organized and managed.

Lattice Framework Introduction Lattice is a powerful, lightweight business extension invoke framework. By using the Lattice framework, complex busines

null 41 Dec 30, 2022
💡极致性能的企业级Java服务器框架,RPC,游戏服务器框架,web应用服务器框架。(Extreme fast enterprise Java server framework, can be RPC, game server framework, web server framework.)

?? 为性能而生的万能服务器框架 ?? Ⅰ. zfoo简介 ?? 性能炸裂,天生异步,Actor设计思想,无锁化设计,基于Spring的MVC式用法的万能RPC框架 极致序列化,原生集成的目前二进制序列化和反序列化速度最快的 zfoo protocol 作为网络通讯协议 高可拓展性,单台服务器部署,

null 1k Jan 1, 2023
RESTX, the lightweight Java REST framework

RESTX - the lightweight Java REST framework RESTX is a full lightweight disrupting stack, which includes Swagger-like ui & considers REST specs tests

null 437 Oct 22, 2022
A fast, lightweight and more productive microservices framework

A fast, lightweight and cloud-native microservices framework. Stack Overflow | Google Group | Gitter Chat | Subreddit | Youtube Channel | Documentatio

null 3.5k Jan 5, 2023
Simple and extensible identity management service

AuthGuard An easy-to-use, and easy-to-customize, identity server. It supports multiple authentication and authorization options and can be extended to

null 7 Jan 9, 2022
Drone - A service via REST API that allows clients to communicate with drones

Drone - A service via REST API that allows clients to communicate with drones (i.e. **dispatch controller**). The specific communication with the drone is outside the scope of this task.

Obinna Ogbonna 1 Jan 10, 2022
Spring MSA api gateway & service discovery with consul & Jaeger & Cassandra

Spring-Cloud-MSA 준비 Cassandra 서버를 준비한다 table.sql 파일로 keyspace와 테이블을 만들어 둔다 Consul 1.11.1버전 기준 https://www.consul.io/downloads 에서 1.11.1 버전 운영체제 맞게 다운

INSUNG CHOI 2 Nov 22, 2022
Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Spring controller interface

Restler Overview Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Sprin

Excelsior LLC 29 Oct 24, 2022
SnoopEE - A Discovery Service for Java EE

SnoopEE - A Discovery Service for Java EE SnoopEE [ˈsnuːpı] is an experimental registration and discovery service for Java EE based microservices. Sno

Ivar Grimstad 76 Feb 18, 2022
The ANT HAL Service functions as a JNI wrapper for the ANT HAL.

Android ANT HAL Service v.4.0.0 - 25 Aug 2014 The ANT HAL Service functions as a JNI wrapper for the ANT HAL. The ANT Hal Service provides the messagi

Project Kaleidoscope 0 Jun 11, 2022
A secured RESTful service for company payrolls.

Account Service A RESTful service for a company to upload employee payrolls. Scope Project was created as part of a learning track of an online academ

Alexios Giazitzis 1 Feb 14, 2022
SpringBoot service to pick up CAN messages retransmitted by CANBridge and extract certain values for reporting/monitoring/alerting via DataDog

SpringBoot service to pick up CAN messages retransmitted by CANBridge and extract certain values for reporting/monitoring/alerting via DataDog

Grumpy Cricket 2 Mar 12, 2022
Critter Chronologer a Software as a Service application that provides a scheduling interface for a small business that takes care of animals

Critter Chronologer a Software as a Service application that provides a scheduling interface for a small business that takes care of animals. This Spring Boot project will allow users to create pets, owners, and employees, and then schedule events for employees to provide services for pets.

Rasha Omran 1 Jan 28, 2022
Spring REST service built with Spring initializr and Spring Data.

Spring REST Service Generated with start.spring.io, using Spring Data. Documented using Spring REST Docs. Spring Initializr - Generate new Spring Rest

null 1 Jan 28, 2022
A simple and efficient short URL conversion service based on SpringBoot.

A simple and efficient short URL conversion service based on SpringBoot What is GeniusShortUrl? GeniusShortUrl is an open source reactive service that

null 2 Apr 8, 2022
A platform that links service providers with clients using Angular & Springboot

Bricoly : Engineer Your Life The Way It Should Be... ?? Description This project's aims to connect people who are able to grant services with clients

Yasser Douslimi 9 May 28, 2022
Transfer Service app to transfer money between source and destination account

transferserviceapp Transfer Service app to transfer money between source and destination account H2 Console available at : http://localhost:8080/h2-co

null 1 Oct 21, 2021
A reservation service of the Innovation academy for visitors.

42Visitor_server 스웨거 문서 주소: http://localhost:8080/swagger-ui.html AWS SMS 기능 사용 시 설정 ./src/main/resources/application-local.properties cloud.aws.regio

Innovation Academy 1 Nov 17, 2021
Service that will swap rbtc for btc and then initiated a loopin through lnd-loop

Code https://github.com/grmkris/marduk-admin-frontend https://github.com/grmkris/marduk-admin-backend RSK balances https://wiki.sovryn.app/en/technica

Kris 2 Dec 31, 2021