Stateful Function applications are composed of one or more
A module is a bundle of functions that are loaded by the runtime and available to be messaged.
Functions from all loaded modules are multiplexed and free to message each other arbitrarily.
Stateful Functions supports two types of modules: Embedded and Remote.
Embedded modules are co-located with, and embedded within, the Apache Flink® runtime.
This module type only supports JVM based languages and are defined by implementing the
Embedded modules offer a single configuration method where stateful functions are bound to the system based on their function type.
Runtime configurations are available through the
globalConfiguration, which is the union of all configurations in the applications
flink-conf.yaml under the prefix
statefun.module.global-config and any command line arguments passed in the form
Embedded modules leverage Java’s Service Provider Interfaces (SPI) for discovery.
This means that every JAR should contain a file
org.apache.flink.statefun.sdk.spi.StatefulFunctionModule in the
META_INF/services resource directory that lists all available modules that it provides.
Remote modules are run as external processes from the Apache Flink® runtime; in the same container, as a sidecar, or other external location.
This module type can support any number of language SDK’s.
Remote modules are registered with the system via
YAML configuration files.
A remote module configuration consists of a
meta section and a
meta contains auxillary information about the module.
spec describes the functions contained within the module and defines their persisted values.
module.spec.functions declares a list of
function objects that are implemented by the remote module.
function is described via a number of properties.
http+unix://<socket-file-path>/<serve-url-path>. For example,
nameproperty and an optional
expireAfter- 0, meaning that state expiration is disabled.
addressbefore invoking backpressure on the system.