You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to rdkafka.
While doing that, I noticed that the implementation impl BinaryDeserializer for ConsumerRecordDeserializer and impl<'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 some T that implements a given trait.
The trait should provide methods to retrieve the headers, the payload and also provide the CE prefix (as it is ce_ with Kafka and ce- with http).
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 to
rdkafka
.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 some
T
that implements a given trait.The trait should provide methods to retrieve the headers, the payload and also provide the CE prefix (as it is
ce_
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 😊
The text was updated successfully, but these errors were encountered: