Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-27598

Research replacing librdkafka dependency with lightweight alternatives for CloudEvents Kafka implementations

XMLWordPrintable

    • Icon: Spike Spike
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Global Hub
    • Future Sustainability
    • False
    • Hide

      None

      Show
      None
    • False
    • None

        1. 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.

        1. 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
        1. Investigation Scope
          1. 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
          1. 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)

          1. 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

          1. 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?
        1. 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
        1. 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)

              rh-ee-myan Meng Yan
              rh-ee-myan Meng Yan
              Yaheng Liu Yaheng Liu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: