feat(connectors): add S3 sink connector#3103
Open
atharvalade wants to merge 4 commits intoapache:masterfrom
Open
feat(connectors): add S3 sink connector#3103atharvalade wants to merge 4 commits intoapache:masterfrom
atharvalade wants to merge 4 commits intoapache:masterfrom
Conversation
Write Iggy stream messages to Amazon S3 and S3-compatible stores with buffered uploads, configurable rotation, and deterministic offset-based keys.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3103 +/- ##
============================================
- Coverage 72.74% 72.72% -0.02%
Complexity 943 943
============================================
Files 1117 1123 +6
Lines 96342 97081 +739
Branches 73543 74298 +755
============================================
+ Hits 70083 70607 +524
- Misses 23715 23903 +188
- Partials 2544 2571 +27
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2956
Rationale
Iggy lacks a native way to write stream messages to Amazon S3 and S3-compatible stores (MinIO, Cloudflare R2, Backblaze B2, DigitalOcean Spaces). This is a frequently requested capability for data lake ingestion and long-term archival pipelines.
What changed?
There was no connector for persisting Iggy messages to object storage. Users had to build custom consumers and upload logic to get data into S3.
This PR adds a new
iggy_connector_s3_sinkcrate that implements theSinktrait. It buffers messages in-memory per stream/topic/partition, rotates files by size or message count, renders S3 keys from a configurable path template ({stream}/{topic}/{date}/{hour}/...), and uploads with retry + exponential backoff. Supportsjson_lines,json_array, andrawoutput formats with optional Iggy metadata and header embedding. Usesrust-s3(already in workspace) with path-style addressing auto-enabled for custom endpoints.Key implementation details:
lib.rs(config + entry point),client.rs(S3 client init + bucket verification),buffer.rs(in-memory accumulation + rotation logic),formatter.rs(JSON/raw output + metadata/header inclusion),path.rs(template engine for S3 keys with offset-based filenames),sink.rs(Sink trait: open/consume/close lifecycle)_build_rust_artifacts.ymlandedge-release.ymlfor cdylib plugin builds and release notesLocal Execution
cargo fmt --check-- passcargo clippy --tests -D warnings-- pass (zero warnings)cargo test -p iggy_connector_s3_sink-- 36/36 passmarkdownlint --check-- passtrailing-whitespace-- passtrailing-newline-- passlicense-headers-- passAI Usage
-D warnings, and end-to-end testing with MinIO Docker + Iggy server + CLI producer + connector runtimeHere are all the relevant screenshots:
iggy-testbucketapplication_logsand topicapi_requests.jsonlfile in the correct path structure (application_logs/api_requests/{date}/{hour}/)cargo clippy --tests -D warningspassing with zero warnings