Reputation: 224
When I examine State functions modules I found below results.
https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.0/sdk/python.html -> The Python SDK is supported as a remote module.
https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.0/sdk/java.html -> The Java SDK is supported as an embedded_module.
https://ci.apache.org/projects/flink/flink-statefun-docs-release-2.0/sdk/modules.html -> This module type can support any number of language SDK’s. Remote modules are registered with the system via YAML configuration files.
Stateful Function applications communicate with the Apache Flink runtime using http. The Python SDK ships with a RequestReplyHandler that automatically dispatches function calls based on RESTful HTTP POSTS. The RequestReplyHandler may be exposed using any HTTP framework.
How can I serve requests in JAVA? Is there example remote functions for Java SDK?
Also Can I mix embedded and co-located/remote functions? For example,If I egress such as statistics of customer(sum,count,avg etc.) to another kafka topic and then I ingress that topic and I can use remote functions with python sdk. Remote functions includes updatable scenario but embeded functions are core stats of customer and not necessary update these functions.
Upvotes: 0
Views: 630
Reputation: 345
Is there a remote Java SDK
There is no Java remote SDK today but I would expect to see one soon based on discussions on the Apache Flink dev mailing list.
Remote SDKs such as python are effectively convenience wrappers around the generic Http interface. What I mean by that is there is no python specific logic in the statefun runtime and so you could today implement a remote function in any language. Obviously, the flink community doesn't want to force that on people and so new remote sdk's are being developed for future releases.
Also Can I mix embedded and co-located/remote functions?
Yes, there is no special magic. Just include both modules in one deployment and your good to go. Functions in either module can message each other arbitrarily.
You can reference this model serving example, which contains both embedded java functions and remote python functions.
https://github.com/ververica/flink-statefun-workshop
Upvotes: 1