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

Support for extracting data from the key or headers of a kafka message #31

Open
olivierdeckers opened this issue Mar 10, 2023 · 1 comment

Comments

@olivierdeckers
Copy link

Currently, the payload is the only part of a kafka record that’s parsed from what I can tell. It would be nice to be able to extract information from headers and keys as well.

@emanb29
Copy link
Contributor

emanb29 commented Mar 10, 2023

This is a great suggestion. We don't currently have a plan to add such a feature, but this would be a great contribution.

Some initial thoughts to contribute:
To preserve API compatibility, we could add a new (optional / opt-in) flag to a kafka ingest configuration like
includeMeta: Boolean = false (indicating it defaults to false if unspecified in the JSON payload)

When includeMeta is true, the $that value passed to the ingest query could take a different shape -- for example

{
  kafkaMeta: ...,
  data: ... (i.e., $that if includeMeta were false)
}

Negotiating this type change between the "ingest source layer" (i.e., "kafka") and the "ingest format layer" (e.g., CypherJson, CypherProtobuf) could be a bit tricky -- the format needs to be aware since that layer goes bytes => intermediate records but the ingest source layer also needs to be aware since that layer goes connection to kafka => record bytes. Not sure how to resolve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants