-
Spike
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
Future Sustainability
-
False
-
-
False
-
-
-
None
-
- Background
Investigate replacing librdkafka dependency with pure Go implementation. Currently using confluent-kafka-go which requires CGO and librdkafka C library, causing high build complexity. Research using Sarama (pure Go) as an alternative and evaluate if it meets all functional requirements.
-
- Problem Origin
PR #2148 failed during Konflux build:
- Error: `fatal error: librdkafka/rdkafka.h: No such file or directory`
- Dependency chain: inventory_reconciler → pkg/transport/config → confluent-kafka-go → librdkafka (CGO)
- Temporary fix: Created operator-specific parser to avoid importing confluent-kafka-go
- PR: https://github.com/stolostron/multicluster-global-hub/pull/2148
-
- Investigation Scope
-
-
- 1. CloudEvents Kafka Protocol Implementations
-
*Current*:
- github.com/cloudevents/sdk-go/protocol/kafka_confluent/v2
- Requires CGO and librdkafka C library
*Alternative*:
- github.com/cloudevents/sdk-go/protocol/kafka_sarama/v2
- Pure Go, no CGO dependencies
-
-
- 2. Component Evaluation
-
*Manager*: Uses confluent for CloudEvents transport (TLS, SASL, compression, consumer groups)
*Agent*: Uses confluent for CloudEvents transport (message ordering, delivery guarantees, exactly-once semantics)
-
-
- 3. Migration Impact
-
*Performance*: Throughput, latency, resource consumption
*Features*: Message ordering, delivery semantics, consumer group rebalancing, error handling
*Build Simplification*: Remove CGO dependency, simplify cross-compilation, reduce image size, easier Konflux/CI integration
*Code Changes*: Manager/Agent modifications, config updates, testing updates
-
-
- 4. Decision Criteria
-
- Can Sarama meet all Kafka requirements?
- Acceptable performance (multi-hub, high throughput)?
- Reduce operational complexity?
- Improve build reliability and simplicity?
- Maintain backward compatibility or clear migration path?
-
- Value
- *Simplified builds*: No more librdkafka-devel in Konflux/CI
- *Better portability*: Pure Go enables easier cross-compilation
- *Reduced complexity*: No C library version management
- *Maintained functionality*: All current features continue to work
-
- Deliverables
- [ ] Feature comparison matrix (confluent-kafka-go vs sarama)
- [ ] Performance benchmark results (throughput, latency p50/p95/p99, resource consumption, multi-hub scenarios)
- [ ] Migration impact analysis (code changes, testing strategy, rollback plan)
- [ ] Clear recommendation: keep confluent or migrate to sarama (with justification, risk assessment, timeline)
- [ ] If migrate: POC in test environment (basic functionality, TLS/SASL/consumer groups validation, performance validation)
—
🤖 Generated with [Claude Code](https://claude.com/claude-code)