In the Java SDK, FunctionType acts as a logical pointer composed of a namespace and a name. You bind a FunctionType to an implementing class during registration. Once defined, you can use this type to address and message specific function instances via the Context.
- Define the type:
public static final FunctionType HELLO_TYPE = new FunctionType("apache/flink", "hello");
- Send a message using the type:
context.send(Identifiers.HELLO_TYPE, "user1", new MyUserMessage());
package org.apache.flink.statefun.docs;
import org.apache.flink.statefun.sdk.FunctionType;
/** A function type that will be bound to {@link FnHelloWorld}. */
public class Identifiers {
public static final FunctionType HELLO_TYPE = new FunctionType("apache/flink", "hello");
}