My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Provides components implementing various patterns for managing app and service availability, performance and capacity. Based in part upon patterns in the Release It! book by Michael Nygard.

Harden your app in two easy steps

Let's say you want to protect an integration point with a so-called circuit breaker on the client side and a throttle on the service side. While you could certainly code that logic by hand, with Kite you don't need to do that. Instead all it takes is two steps. First, you'll need to create the circuit breaker and throttle:

<beans:beans xmlns="http://springinpractice.com/schema/kite"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context" ...>

    <!-- Activate Kite annotations -->
    <annotation-config />

    <!-- Create the circuit breaker and the throttle -->
    <circuit-breaker id="messageServiceBreaker" exceptionThreshold="3" timeout="30000" />
    <throttle id="messageServiceThrottle" limit="50" />

    <!-- Export the breaker and throttle as MBeans -->
    <context:mbean-export />

</beans:beans>

Second, you'll need to annotate the service methods. I'm assuming a transactional service here, though that's not required:

@Service
@Transactional(
    propagation = Propagation.REQUIRED,
    isolation = Isolation.DEFAULT,
    readOnly = true)
public class MessageServiceImpl implements MessageService {

    @GuardedByCircuitBreaker("messageServiceBreaker")
    @GuardedByThrottle("messageServiceThrottle")
    public Message getMotd() { ... }

    @GuardedByCircuitBreaker("messageServiceBreaker")
    @GuardedByThrottle("messageServiceThrottle")
    public List<Message> getMessages() { ... }
}

Voila: all calls to the service methods are now guarded by (1) a breaker that trips after three consecutive exceptions, and retries after 30 seconds, and (2) a fail-fast concurrency throttle that rejects requests once the limit of 50 concurrent requests is exceeded. Kite knows that the circuit breaker goes in front of the throttle, so you don't need to worry about that. As an added bonus, the breaker and throttle are both exposed as MBeans for manual tripping, resetting, etc. by your NOC should the need arise.

Besides the annotation-based approach illustrated above, the standard template- and AOP-based approaches are also available.

Overview of components

This is a brand-new project, so there's not much yet, but here's what exists now:

Circuit breaker: Trips after a configurable number of consecutive exceptions, and retries after a configurable timeout. Eventually it will be possible to trip based of failure rates, and it will be possible to select specific exception types.

Throttle: A fail-fast concurrency throttle that rejects requests once a configurable concurrency limit is reached. Eventually throttles will be able to reject requests based on failure to meet SLAs.

Kite news

2012-05-13: OK, I've created this project over at GitHub. I will migrate content over there and then shut this one down.

2012-05-13: I will be moving this project to GitHub shortly, where it will get more attention than I've been giving it.

2010-04-27: Posted kite-0.3.jar to the downloads. Right now it's just a JAR file containing the library. The source is available via anonymous SVN download.

2010-03-24: Can now specify which exceptions the circuit breaker is to handle. Unhandled exceptions simply pass through the breaker without incrementing the exception count and without tripping the breaker.

2010-03-17: Implemented annotation support for throttles as well, so now we have two full-stack (template, AOP, annotations) components.

2010-03-15: Split up the sample apps, and added Hibernate-based transactions to demonstrate the interaction between Kite advisors and the transaction advisor.

2010-03-13: It's now possible to annotate individual methods with @GuardedByCircuitBreaker.

2010-03-02: Added basic annotation support (@GuardedByCircuitBreaker). Right now only type scope is supported, but I'll fix that shortly. Want to be able to guard specific methods.

2010-02-27: Added Kite custom namespace for configuration.

2010-02-26: Added MBean exporter to the sample app. This allows admins to trip and reset breakers through a JMX management console.

Also added FailFastConcurrencyThrottle, along with AOP interceptor.

2010-02-25: No downloads yet, but you can check out the existing code from SVN. It builds using Maven 2. So far there is a [wiki/CircuitBreaker circuit breaker] (implemented as a Spring template) along with very basic AOP support. There's also a sample app so you can see how it works.

Powered by Google Project Hosting