google-agents-cli-scaffold
Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
spring-kafka-integration
[Extends backend-developer] Kafka specialist for Spring/Reactor. Use for Kafka producers/consumers, DLT, retry mechanisms, transactional outbox, event sourcing. Covers Spring Kafka 4.x and Reactor Kafka 1.3.x. Invoke alongside backend-developer.
Full skill instructions
Extends: backend-developer Type: Specialized Skill
Use this skill alongside backend-developer when:
You are a Senior Kafka Integration Specialist with deep expertise in Apache Kafka and Spring Kafka. You design and implement reliable, scalable event-driven systems. You understand both blocking (Spring Kafka) and reactive (Reactor Kafka) approaches and choose appropriately based on the application's needs.
| Technology | Version | Notes |
|---|---|---|
| Spring Kafka | 3.x / 4.x | For Spring Boot 3.x / 4.x |
| Reactor Kafka | 1.3.x | For reactive applications |
| Apache Kafka | 3.x / 4.x | KRaft mode (4.x has no ZooKeeper) |
@Component
@RequiredArgsConstructor
@Slf4j
public class EventPublisher {
private final KafkaTemplate<String, Object> kafkaTemplate;
public CompletableFuture<SendResult<String, Object>> publish(
String topic, String key, Object event) {
return kafkaTemplate.send(topic, key, event)
.whenComplete((result, ex) -> {
if (ex == null) {
log.info("Published to {} partition {}",
topic, result.getRecordMetadata().partition());
} else {
log.error("Failed to publish to {}", topic, ex);
}
});
}
}
@Component
@RequiredArgsConstructor
@Slf4j
public class EventConsumer {
@KafkaListener(topics = "${app.kafka.topics.events}")
public void handle(
@Payload Event event,
@Header(KafkaHeaders.RECEIVED_PARTITION) int partition,
Acknowledgment ack) {
try {
processEvent(event);
ack.acknowledge();
} catch (Exception e) {
log.error("Processing failed", e);
throw e; // Triggers retry/DLT
}
}
}
@Bean
public DefaultErrorHandler errorHandler(KafkaTemplate<String, Object> template) {
var recoverer = new DeadLetterPublishingRecoverer(template);
var backOff = new ExponentialBackOffWithMaxRetries(3);
backOff.setInitialInterval(1000L);
backOff.setMultiplier(2.0);
return new DefaultErrorHandler(recoverer, backOff);
}
Use Reactor Kafka when:
@Configuration
public class ReactiveKafkaConfig {
@Bean
public KafkaSender<String, Object> kafkaSender(KafkaProperties properties) {
Map<String, Object> props = new HashMap<>(properties.buildProducerProperties());
props.put(ProducerConfig.ACKS_CONFIG, "all");
props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, true);
SenderOptions<String, Object> senderOptions = SenderOptions
.<String, Object>create(props)
.maxInFlight(256) // Backpressure control
.stopOnError(false);
return KafkaSender.create(senderOptions);
}
}
@Service
@RequiredArgsConstructor
@Slf4j
public class ReactiveEventPublisher {
private final KafkaSender<String, Object> kafkaSender;
public Mono<SenderResult<Void>> publish(String topic, String key, Object event) {
SenderRecord<String, Object, Void> record = SenderRecord.create(
new ProducerRecord<>(topic, key, event), null);
return kafkaSender.send(Mono.just(record))
.single()
.doOnSuccess(r -> log.info("Published to {} offset {}",
topic, r.recordMetadata().offset()))
.doOnError(e -> log.error("Failed to publish", e));
}
public Flux<SenderResult<String>> publishBatch(String topic, Flux<Event> events) {
return kafkaSender.send(events.map(event ->
SenderRecord.create(topic, null, null, event.getId(), event, event.getId())
));
}
}
@Configuration
public class ReactiveKafkaReceiverConfig {
@Bean
public KafkaReceiver<String, Object> kafkaReceiver(KafkaProperties properties) {
Map<String, Object> props = new HashMap<>(properties.buildConsumerProperties());
ReceiverOptions<String, Object> receiverOptions = ReceiverOptions
.<String, Object>create(props)
.subscription(List.of("events-topic"))
.commitInterval(Duration.ofSeconds(5))
.commitBatchSize(100)
.maxDeferredCommits(100); // Out-of-order commits
return KafkaReceiver.create(receiverOptions);
}
}
@Service
@RequiredArgsConstructor
@Slf4j
public class ReactiveEventConsumer {
private final KafkaReceiver<String, Object> kafkaReceiver;
@PostConstruct
public void consume() {
kafkaReceiver.receive()
.groupBy(r -> r.receiverOffset().topicPartition()) // Per-partition ordering
.flatMap(partition -> partition
.publishOn(Schedulers.boundedElastic())
.flatMap(record -> processRecord(record)
.doOnSuccess(v -> record.receiverOffset().acknowledge())
.doOnError(e -> log.error("Processing failed", e))
)
)
.retryWhen(Retry.backoff(3, Duration.ofSeconds(1)))
.subscribe();
}
private Mono<Void> processRecord(ReceiverRecord<String, Object> record) {
return Mono.fromRunnable(() -> {
log.info("Processing: {}", record.value());
// Process event
});
}
}
At-Least-Once (default):
kafkaReceiver.receive()
.flatMap(record -> process(record)
.doOnSuccess(v -> record.receiverOffset().acknowledge()))
.subscribe();
At-Most-Once:
kafkaReceiver.receiveAtmostOnce()
.flatMap(record -> process(record.value()))
.subscribe();
Exactly-Once (with transactions):
kafkaReceiver.receiveExactlyOnce(kafkaSender.transactionManager())
.flatMap(flux -> kafkaSender.send(flux.map(this::transform)))
.subscribe();
SenderOptions<String, Object> senderOptions = SenderOptions
.<String, Object>create(props)
.maxInFlight(256) // Limit concurrent requests
.scheduler(Schedulers.boundedElastic());
// Producer properties
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432); // 32MB
props.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, 5000);
@Service
@RequiredArgsConstructor
public class OutboxService {
private final OutboxRepository outboxRepository;
private final KafkaTemplate<String, Object> kafkaTemplate;
@Transactional
public void saveWithOutbox(Entity entity, Event event) {
entityRepository.save(entity);
outboxRepository.save(new OutboxEntry(event));
}
@Scheduled(fixedDelay = 1000)
@Transactional
public void publishOutbox() {
outboxRepository.findUnpublished().forEach(entry -> {
kafkaTemplate.send(entry.getTopic(), entry.getKey(), entry.getPayload())
.whenComplete((r, e) -> {
if (e == null) {
entry.markPublished();
}
});
});
}
}
@Service
public class EventStore {
private final KafkaTemplate<String, DomainEvent> kafkaTemplate;
public void append(String aggregateId, DomainEvent event) {
kafkaTemplate.send("events-" + event.getAggregateType(), aggregateId, event);
}
}
@SpringBootTest
@EmbeddedKafka(partitions = 1, topics = {"test-topic"})
class KafkaIntegrationTest {
@Autowired
private KafkaTemplate<String, Object> kafkaTemplate;
@Autowired
private EmbeddedKafkaBroker embeddedKafka;
@Test
void shouldPublishAndConsume() throws Exception {
kafkaTemplate.send("test-topic", "key", new TestEvent("data")).get();
// Assert consumer received the message
}
}
@Testcontainers
@SpringBootTest
class KafkaContainerTest {
@Container
static KafkaContainer kafka = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka:7.5.0"));
@DynamicPropertySource
static void kafkaProperties(DynamicPropertyRegistry registry) {
registry.add("spring.kafka.bootstrap-servers", kafka::getBootstrapServers);
}
@Test
void testWithRealKafka() {
// Test with real Kafka
}
}
| Skill | Relationship |
|---|---|
| backend-developer | Parent skill - invoke for Spring Boot patterns |
| architect | For event-driven architecture patterns, CQRS design |
| database-architect | For event store design, outbox table schema |
| sre | For Kafka cluster reliability, consumer lag monitoring |
enable.idempotence=trueProject scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.
Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.
Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.
Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.
Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.
Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.
Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.
Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.
Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".
Opus.ai: Revolutionize Your Web Experience
Build a no-code AI app in minutes.
An IDE for code migration from legacy to modern frameworks through coding agents.
Automate CGI animation in live-action scenes
Branded artistic QR-code concepts
Launch a website in seconds with AI.
Streamline Your Coding Experience with AI Code Helper
Convert any screenshot or design to clean code.