Re: Flink Statefun Byte Ingress
Posted by
Igal Shilman on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-Statefun-Byte-Ingress-tp38289p38305.html
Hi,
For ingress, we don't look at the content at all, we put the bytes "as-is" into the Any's value field, and we set the typeUrl field
with whatever was specified in the module.yaml.
Hope that helps,
Igal.
Hi Igal,
Ah that definitely helps to know for Function -> Function invocations, but when doing Ingress via statefun how would that work? Is there a config I can set in the "module.yaml" to have it just pack arbitrary bytes into the Any?
Thanks,
Tim
Hi Tim,
You are correct, currently the argument to a remote function must be a Protobuf Any, however StateFun doesn't interpret the contents of that Any, and it would be passed as-is to the remote function.
As you mentioned in your email you can interpret the bytes as the bytes of a JSON string.
I hope it helps,
Igal.
Hi,
So most of the examples of "module.yaml" files I've seen focus on protobuf ingress, but is there a way to just get bytes from Kafka? I want to integrate this with the rest of my codebase which uses JSON, but don't want to migrate to protobuf just yet. I'm not totally sure how it would work since function arguments seem to be encoded as an Any type which is a protobuf type string + some bytes, I guess the string would need to be some made up constant value and I'd just grab the bytes? Honestly just using bytes like is done with the state value might be a bit more flexible to work with.
Thanks,
Tim