Implement production-grade Kafka consumers that reliably consume and process domain events with high performance, type safety, and comprehensive error recovery. Covers msgspec deserialization, confluent-kafka configuration, offset management, OpenTelemetry tracing, and anti-corruption layer patterns for translating message schemas to domain models.
Use when building event-driven systems that consume domain events from Kafka topics with "implement Kafka consumer", "consume events from Kafka", "process order messages", or "set up event consumer".
Do NOT use when mocking Kafka consumers in unit tests (use pytest-adapter-integration-testing), implementing producers (use kafka-producer-implementation), or testing with testcontainers (use kafka-integration-testing).
Implementare consumer Kafka indipendenti dal tipo per il consumo di eventi con la deserializzazione msgspec. Da utilizzare durante la creazione di consumatori asincroni che elaborano eventi del dominio (messaggi di ordine, transazioni) con gestione dell'offset, ripristino degli errori, arresto regolare e tracciabilità distribuita. Gestisce la configurazione del consumatore, i commit manuali e le strategie di ribilanciamento. Fonte: dawiddutoit/custom-claude.