public interface StatefulFunctionModule
StatefulFunctionModuleis the entry point for adding to a Stateful Functions application the core building block primitives, i.e.
A Stateful Functions application is built up of ingresses, egresses, routers, and stateful
functions that are added to the application by multiple different
StatefulFunctionModules. This allows different parts of the application to be contributed by
different modules; for example, one module may provide ingresses and egresses, while other
modules may individually contribute specific parts of the application as stateful functions.
The extensibility is achieved by leveraging the Java Service Loader. In this context, each module is essentially a service provider.
In order for an application to discover a given module, likewise to how the Java Service
Loader works, a UTF-8 encoded provider configuration file needs to be stored in the
META-INF/services directory of the module's containing JAR file. The name of the file should be
org.apache.flink.statefun.sdk.spi.StatefulFunctionModule, i.e. the fully qualified name
StatefulFunctionModule class. Each line in the file should be the fully qualified
class name of a module in that JAR that you want to register for the Stateful Functions
application. The configuration file may also be automatically generated using Google's AutoService tool.
Finally, to allow the Stateful Functions runtime to discover the registered modules, the JAR
files containing the modules and provider configuration files should be added to a
system-specific class path directory,
For a simple demonstration, you can consult the
|Modifier and Type||Interface and Description|
|Modifier and Type||Method and Description|
This method is the entry point for extending a Stateful Functions application by binding ingresses, egresses, routers, and functions.
void configure(java.util.Map<java.lang.String,java.lang.String> globalConfiguration, StatefulFunctionModule.Binder binder)
globalConfiguration- global configuration of the Stateful Functions application.
binder- the binder to be used to bind ingresses, egresses, routers, and functions.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.