spring-kafka

Build Spring Kafka producers and consumers with retry, DLT, and embedded Kafka tests.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/ririnto/sinon --skill spring-kafka-ririnto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-kafka
Source: https://github.com/ririnto/sinon/tree/main/plugins/spring/skills/spring-kafka
Command: npx skills add https://github.com/ririnto/sinon --skill spring-kafka-ririnto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building Spring Kafka apps can be verbose; this skill provides a guided pattern to implement Kafka producers and consumers using Spring's KafkaTemplate and @KafkaListener, with clear boundaries for retries, dead-lettering, and testing.

Core Features & Use Cases

  • Centralized guidance for topic declarations, listener configuration, retry/DLT policies, and embedded Kafka tests.
  • Use cases include building reliable messaging in microservices, validating end-to-end flows with embedded Kafka, and implementing error-handling strategies.
  • Real-world scenario: implement a payments flow with a producer that publishes events and a listener that processes them with retry and DLT.

Quick Start

Create a Spring Boot project, configure Spring Kafka with a KafkaTemplate and a @KafkaListener, and add a basic retry/Dead-Letter setup with an embedded Kafka test.

Frequently Asked Questions about spring-kafka

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a KafkaTemplate and @KafkaListener in a Spring Boot microservice?

Configuring a KafkaTemplate and @KafkaListener in Spring Boot involves declaring topics, setting up Spring Kafka 4.x properties, and annotating listener methods to process incoming messages. This approach streamlines building reliable producers and consumers for microservices.

What is the best way to implement retry and dead-letter topics in Spring Kafka?

Implementing retry and dead-letter topics in Spring Kafka requires configuring specific error-handling policies within your @KafkaListener setup. This ensures failed messages are automatically retried and eventually routed to a DLT for reliable microservices messaging.

How do I test Kafka producer and consumer flows with embedded Kafka?

Testing Kafka producer and consumer flows with embedded Kafka involves setting up an embedded Kafka test environment within your Spring Boot tests. This validates end-to-end message processing, retry logic, and DLT routing without needing an external broker.

Does Spring Kafka 4.x support centralized topic declaration and management?

Yes, Spring Kafka 4.x supports centralized topic declaration and management. You can programmatically declare and manage your Kafka topics within your Spring Boot application context to ensure topics exist before producers and listeners operate.

How do I build a reliable payments event flow using Spring Kafka?

Building a reliable payments event flow using Spring Kafka involves creating a producer that publishes payment events and a @KafkaListener that processes them. You integrate retry policies and dead-letter topics to handle processing failures gracefully.

Why do I need a dead-letter topic for my @KafkaListener message processing?

You need a dead-letter topic for @KafkaListener message processing to capture messages that fail after exhausting retries. This prevents poison pill messages from blocking your consumer pipeline and allows for later analysis of processing errors.