Skip to content

Streaming: placeholder processors fake Kafka delivery when the backend feature is off #23

Closed

Description

@CodingAnarchy

Without the backend's cargo feature, src/streaming.rs compiles placeholder processors in place of the real ones. The streaming feature without kafka, kinesis or google-pubsub gets these placeholders.

Problem

  • Kafka placeholder fakes delivery (impl StreamProcessor for KafkaProcessor, #[cfg(not(feature = "kafka"))]). send_batch sleeps for a configurable batch.delay.ms and reports success for each event, failing only at a random rate taken from a test.error.rate config key. health_check also simulates success. A Kafka stream configured without the kafka feature drops every event while reporting it as delivered.
  • The Kinesis and Pub/Sub placeholders do report failure ("feature not enabled"), but only per event at send time, rather than when the stream is configured.
  • The placeholder structs keep fields they never read, so the build warns with streaming alone.

Expected

  • Creating a processor for a backend whose feature isn't enabled fails immediately with a clear HammerworkError::Streaming naming the feature to enable, so StreamManager::add_stream / from_config reject the stream.
  • No simulated success or randomness in library code. Remove the batch.delay.ms / test.error.rate knobs.
  • Tests that relied on placeholder simulation either use a test-only processor or assert the fail-fast error.
  • Add postgres,streaming back to the CI feature combinations matrix; it's excluded until this is fixed.

Part of #7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions