Kite / documentation
Kite documentation.
The two step setup from the original project page, plus the guard settings used in the example.
What Kite does
Kite adds three guards to Spring service methods:
- Circuit breaker. Stops calls after a threshold of consecutive exceptions and retries after a timeout.
- Concurrency throttle. Rejects requests once a concurrency limit is reached.
- Rate limiter. Rejects requests beyond a client limit in a time window.
Step 1. Create your guards
<?xml version="1.0" encoding="UTF-8"?>
<beans ...>
<kite:annotation-config />
<kite:circuit-breaker id="circuitBreaker" exceptionThreshold="3" timeout="30000" />
<kite:concurrency-throttle id="concurrencyThrottle" limit="50" />
<kite:rate-limiting-throttle id="rateLimiter" limit="5000" />
</beans>
Step 2. Annotate your service
@Service
@Transactional
public class MessageServiceImpl implements MessageService {
@GuardedBy({ "concurrencyThrottle", "rateLimiter", "circuitBreaker" })
public List<Message> getMessages() { ... }
}
Guard reference
| Guard | Setting | Example value |
|---|---|---|
| circuitBreaker | exceptionThreshold | 3 consecutive exceptions |
| circuitBreaker | timeout | 30000 ms |
| concurrencyThrottle | limit | 50 concurrent requests |
| rateLimiter | limit | 5000 requests per hour |
How the guards combine
A method can carry all three annotations. Kite applies each guard to the call, so a request must pass the rate limiter, the concurrency throttle and the circuit breaker before it reaches the service method.
If a dependency is failing, the circuit breaker stops the calls. If traffic spikes, the concurrency throttle protects the service. If a client is noisy, the rate limiter applies the ceiling.