LGouellec / kafka-streams-dotnet

.NET Stream Processing Library for Apache Kafka 🚀
https://lgouellec.github.io/kafka-streams-dotnet/
MIT License
455 stars 74 forks source link

Change timestamp of a record before sink to output #148

Closed lollo25 closed 2 years ago

lollo25 commented 2 years ago

Hello, I'm wondering how I can change the timestamp of a record before the sink. I've tried using IRecordContext within ITopicNameExtractor (even if I understand it's a bit dirty) but anyway it doesn't work.

Thanks

LGouellec commented 2 years ago

Hi @lollo25,

After one test, exactly you can't change the timestamp before sinking to one output topic. IRecordContext is a internal class and ChangeTimestamp was originally an internal method.

The bug 🐛 is here : https://github.com/LGouellec/kafka-streams-dotnet/blob/117b6c5390530abbcfb585fbfab4fadf0acb425d/core/Processors/SinkProcessor.cs#L49

We get the timestamp to check before calling extractor, and we just this local variable in sink record.

Kr,

LGouellec commented 2 years ago

@lollo25,

PR Merged. Will available in 1.3.0 release soon.

Thanks for your contribution.

lollo25 commented 2 years ago

I am working hard over this library so I am very interested in contributing again

LGouellec commented 2 years ago

@lollo25,

I opened a discussion few weeks ago about this library and the use case that users can found. Feel free to post here to show us your use cases.

If you want help, discussing about your use case or something else, you have Discord option, Github issues.

Cheers,