rob3000 / nestjs-kafka

NestJS integration with KafkaJS
The Unlicense
130 stars 44 forks source link

Avro deserializer fails if key is not avro format #29

Closed ColinMorris83 closed 3 years ago

ColinMorris83 commented 3 years ago

Can an option be added to not call decode on message keys, in our case only message values need decoding, and therefore we can't use the built in avro deserialiser class.

Also perhaps the use of a deserialiser can be documented to mention that you must return the message with a response property on it because of this line:

const { timestamp, response, offset, key } = await this.deserializer.deserialize(message, { topic });

As it seems that it's this response property that will be the data in any methods that are decorated with SubscribeTo.

agboon commented 3 years ago

Agree with this issue, made a PR fixing this: https://github.com/rob3000/nestjs-kafka/pull/31 @rob3000 pls review.

rob3000 commented 3 years ago

Thanks @r45boon Just merged this PR

agboon commented 3 years ago

@rob3000 i have a quickfix to this, pls merge https://github.com/rob3000/nestjs-kafka/pull/34