Open DirkRusche opened 7 months ago
Hey @DirkRusche, Sorry for the late response. It would be great if we could simplify this. It would be great if you could find some time to make a PR!
Also, an example with an AWS Lambda and Kafka would be really great :)
Feel free to ping me on Slack if you need help: https://cloud-native.slack.com/team/UTV7ZGPAR
I have an AWS Lambda that consumes messages from Kafka topics, using the crate aws_lambda_events which provides the struct
KafkaRecord
. Unfortunately, I was unable to use this library out of the box. I ended up understanding what the library does and implementing a Deserializer similar tordkafka
.While doing that, I noticed that the implementation
impl BinaryDeserializer for ConsumerRecordDeserializer
andimpl<'a, T: Headers<'a>> BinaryDeserializer for Deserializer<'a, T>
are almost the same. I was wondering if this library can provide a blanket implementation for someT
that implements a given trait. The trait should provide methods to retrieve the headers, the payload and also provide the CE prefix (as it isce_
with Kafka andce-
with http).Something like that (just as a sketch):
If this is from interest and I find some time, I could open a PR. Let me know 😊