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

Kafka transport #5

Closed
matzew opened this issue Nov 7, 2018 · 4 comments
Closed

Kafka transport #5

matzew opened this issue Nov 7, 2018 · 4 comments

Comments

@matzew
Copy link
Member

matzew commented Nov 7, 2018

based on PR cloudevents/spec#337, we could introduce a kafka module here, that helps to encode/decode the CloudEvent class over Kafka, using Headers for the attributes, and using the key/value of the message for the CloudEvents data

We did already do some prototype a couple of month ago:

https://github.com/rh-event-flow/jcloudevents/blob/master/kafka/src/main/java/io/streamzi/cloudevents/kafka/util/KafkaHeaderUtil.java#L42

@matzew
Copy link
Member Author

matzew commented Nov 7, 2018

API Proposal

Implement some util, containg method for:

  • extracting cloudevent from a ConsumerRecord
  • Creating RecordHeaders from a a Cloudevent, and wrap that to the Kafka message

Below is some pseudo code that could be part of the "API" util:

public ProducerRecord createProducerRecord(final CloudEvent<?> e);

public ConsumerRecord createConsomerRecord(final CloudEvent<?> e);

public Headers extractRecordHeaders(final CloudEvent<?> ce);

public <K, V> CloudEvent<Map<K, V>> fromConsumerRecord(final ConsumerRecord<K, V>);
public <K, V> CloudEvent<Map<K, V>> fromProducerRecord(final ProducerRecord<K, V> record);

@fabiojose
Copy link
Contributor

Done the PR #49

Let's close this?

@matzew
Copy link
Member Author

matzew commented Sep 25, 2019 via email

@fabiojose
Copy link
Contributor

This is the docs about Kafka Transport Binding: https://github.com/cloudevents/sdk-java/blob/master/kafka/README.md

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

No branches or pull requests

2 participants