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
Can I Emit
to a KTable?
#344
Comments
Hey @pfortin-urbn. I think the ctx.Loopback() function can solve this. Line 117 in 15746b5
So if you receive a message with the key key_a and you want to update the stored value of key_b you can loopback the message to key_b using ctx.Loopback("key_b", updateMessage) .In the Loop-Edge you define how to update the value. Line 324 in 0085fa7
Here is also a good example. I hope this helps 🙂 |
By KTable do you mean a KTable of Kafka Streams? If yes, you'll need to configure the hash function since Sarama uses a different hash function than the Java clients. You'll need to create an emitter, configure the hash function (murmur2 AFAIR) and pass the emitter object to the process callback. |
Oh sorry for the confusion. Somehow i totally missed the KTable part. |
@db7 Thanks I kinda knew that but wanted to know if there was easier way thanks! |
@frairon - I am in a processor and it has received a message to update the KTable but it could be for another key that the context key. Can I use
ctx.Emit
to update the KTable and if I do that will local storage also be updated? What is the preferred way to update the state of a key that is determined in the processor?The text was updated successfully, but these errors were encountered: