Performance: Kafka integration basics
MEDIUM IMPACT
This affects the responsiveness and throughput of message processing in a web application, impacting how quickly data flows between services.
@KafkaListener(topics = "topicName")
public void consumeAsync(String message) {
CompletableFuture.runAsync(() -> processMessage(message));
}public void consume(String message) {
// process message synchronously
processMessage(message);
// blocks main thread
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous Kafka message processing | N/A | N/A | N/A | [X] Bad |
| Asynchronous Kafka message processing | N/A | N/A | N/A | [OK] Good |