Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination - route records to topic based on metadata #130

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

lovromazgon
Copy link
Member

Description

Adds the ability to specify a Go template in the destination parameter topic. The default of this parameter was changed to {{ index .Metadata "opencdc.collection" }}, which means that records will be routed to the topic based on the collection they come from by default. The user can still specify a static topic.

Additionally, the code in this PR makes producing of records a bit safer, by ensuring that encountering an error when preparing the record won't disregard already produced records. It also sneaks in some housekeeping that makes sure we validate generated files are up to date and that golangci-lint can be updated using dependabot.

Fixes ConduitIO/conduit#1477

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@lovromazgon lovromazgon requested a review from a team as a code owner April 9, 2024 14:53
Copy link
Contributor

@maha-hajja maha-hajja left a comment

Choose a reason for hiding this comment

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

lgtm

tools.go Outdated Show resolved Hide resolved
Copy link
Member

@raulb raulb left a comment

Choose a reason for hiding this comment

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

@lovromazgon code looks great. Just a a couple of questions before approving.

destination/franz.go Outdated Show resolved Hide resolved
destination/franz.go Show resolved Hide resolved
@lovromazgon lovromazgon requested a review from raulb April 10, 2024 14:44
@lovromazgon lovromazgon merged commit fb070a6 into main Apr 10, 2024
4 checks passed
@lovromazgon lovromazgon deleted the lovro/destination-route-to-topic branch April 10, 2024 14:58
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.

MC: Kafka Destination - Write to multiple topics
3 participants