Skip to content

refactor(sink): add a generic Sink wrapper around the Kafka sink - #4

Merged
gagantrivedi merged 3 commits into
mainfrom
generic-sink
Oct 28, 2026
Merged

gagantrivedi merged 3 commits into
mainfrom
generic-sink

Conversation

@gagantrivedi

Copy link
Copy Markdown
Member

First step towards writing events directly to ClickHouse and Postgres. Refs #3

  • The handler passes typed EventRecords to the sink, which encodes them; Kafka wire bytes are unchanged.
  • New Sink enum (Kafka only for now) used by routes, /health and main.
  • New SINK env var (default kafka); Kafka settings are only read when SINK=kafka.

No behaviour change.

@gagantrivedi gagantrivedi changed the title Add a generic Sink wrapper around the Kafka sink refactor(sink): add a generic Sink wrapper around the Kafka sink Oct 27, 2026
The handler passes typed EventRecords to the sink, which encodes them.
New SINK env var (default kafka); Kafka settings are only read when
SINK=kafka. No behaviour change.

Refs #3
Zaimwa9
Zaimwa9 previously approved these changes Oct 27, 2026
Comment thread src/sink/mod.rs Resolved
Comment thread src/config.rs Resolved
Comment thread src/routes/ingest.rs Resolved
Move SinkError to the sink module, with a Kafka variant ready for other
sinks. No behaviour change.

Refs #3
EventRecord borrows traits and metadata as JSON values; serializing the
record encodes them as JSON strings, so the handler does no encoding and
Kafka output is unchanged. Deciding the sink kind no longer reads the
environment, so an unset SINK defaulting to kafka is tested.

Refs #3

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gagantrivedi
gagantrivedi merged commit 6f32768 into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants