chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:42:18 +08:00
commit 05f60106aa
288 changed files with 76871 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
package com.example.kafka;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.annotation.KafkaHandler;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.core.KafkaOperations;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Component;
import lombok.RequiredArgsConstructor;
import reactor.kafka.receiver.KafkaReceiver;
// ── Annotation-based consumer ─────────────────────────────────────────────
@Service
class OrderEventConsumer {
@KafkaListener(topics = "order-events")
public void onOrder(String payload) {}
@KafkaListener(topics = {"order-dlq", "order-retry"})
public void onDlq(String payload) {}
}
// ── Annotation-based producer (KafkaTemplate field) ───────────────────────
@Service
@RequiredArgsConstructor
class NotificationProducer {
private final KafkaTemplate<String, String> kafkaTemplate;
// static field — should NOT produce edge
private static final String TOPIC = "notifications";
}
// ── Reactive consumer (KafkaReceiver field) ───────────────────────────────
@Service
@RequiredArgsConstructor
class ReactiveOrderConsumer {
private final KafkaReceiver<String, OrderEvent> kafkaReceiver;
private final KafkaOperations<String, String> kafkaOps;
}
// ── plain class with no Kafka ─────────────────────────────────────────────
class OrderEvent {
private String id;
}