You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by mrAlexTFB <mr...@gmail.com> on 2022/02/14 16:05:42 UTC

Statefun with no Protobuf ingress and egress

Hi,

I have a very simple schema where one python statefun application reads
from a kafka topic and writes in another kafka topic, those topics are
produced and consumed with another python script as it is done in the Python
Flink Walkthrough
<https://nightlies.apache.org/flink/flink-statefun-docs-release-2.0/getting-started/python_walkthrough.html#what-are-you-building>,
Is there a way to read and write in those topics a plain string (as a JSON)
and not to use Protobuf?

More concrete:
I'm trying to use statefun as a solution for not finding some libraries in
JAVA or SCALA that exists in python, then, I'm trying to combine embedded
Flink applications with statefun applications using with docker a master
and worker with the embedded applications with JobManager and TaskManager,
All the embedded applications communicate using JSON, now that I want to
use an statefun Application in between, is there a way to communicate using
JSON and not protobuf?

Thanks in advance.

Re: Statefun with no Protobuf ingress and egress

Posted by Igal Shilman <ig...@apache.org>.
Hello,
I've noticed that you've linked to a very old release of stateful function
(2.0) where statefun 3.2 which is the latest, added support for exactly
that.
You are no longer required to use Protobuf, and you can simply send strings
and even JSON.
Checkout the following repository for some examples[1]

[1]
https://github.com/apache/flink-statefun-playground/blob/release-3.2/python/greeter/functions.py#L26

Good luck,
Igal

On Mon, Feb 14, 2022 at 5:07 PM mrAlexTFB <mr...@gmail.com> wrote:

> Hi,
>
> I have a very simple schema where one python statefun application reads
> from a kafka topic and writes in another kafka topic, those topics are
> produced and consumed with another python script as it is done in the Python
> Flink Walkthrough
> <https://nightlies.apache.org/flink/flink-statefun-docs-release-2.0/getting-started/python_walkthrough.html#what-are-you-building>,
> Is there a way to read and write in those topics a plain string (as a JSON)
> and not to use Protobuf?
>
> More concrete:
> I'm trying to use statefun as a solution for not finding some libraries in
> JAVA or SCALA that exists in python, then, I'm trying to combine embedded
> Flink applications with statefun applications using with docker a master
> and worker with the embedded applications with JobManager and TaskManager,
> All the embedded applications communicate using JSON, now that I want to
> use an statefun Application in between, is there a way to communicate using
> JSON and not protobuf?
>
> Thanks in advance.
>