Questions tagged [flink-statefun]

Stateful Functions is an API that simplifies building distributed stateful applications. It’s based on functions with persistent state that can interact dynamically with strong consistency guarantees. The runtime is built on Apache Flink®.

Stateful Functions Applications

A stateful function is a small piece of logic/code existing in multiple instances that represent entities — similar to actors. Functions are invoked through messages and are:

  • Stateful: Functions have embedded, fault-tolerant state, accessed locally like a variable.
  • Virtual: Much like FaaS, functions don't reserve resources — inactive functions don't consume CPU/Memory.

Applications are composed of modules of multiple functions that can interact arbitrarily with:

  • Exactly-once Semantics: State and messaging go hand-in-hand, providing exactly-once message/state semantics.
  • Logical Addressing: Functions message each other by logical addresses. No service discovery needed.
  • Dynamic and Cyclic Messaging: Messaging patterns don't need to be pre-defined as dataflows (dynamic) and are also not restricted to DAGs (cyclic).

A Runtime built for Serverless Architectures

The Stateful Functions runtime is designed to provide a set of properties similar to what characterizes serverless functions, but applied to stateful problems.

The runtime is built on Apache Flink, with the following design principles:

  • Logical Compute/State Co-location: Messaging, state access/updates and function invocations are managed tightly together. This ensures a high-level of consistency out-of-the-box.
  • Physical Compute/State Separation: Functions can be executed remotely, with message and state access provided as part of the invocation request. This way, functions can be managed like stateless processes and support rapid scaling, rolling upgrades and other common operational patterns.
  • Language Independence: Function invocations use a simple HTTP/gRPC-based protocol so that Functions can be easily implemented in various languages.

References

89 questions
1
vote
1 answer

Apache Flink Stateful Functions Remote Module Update

How can I update module.yaml dynamically? For example I want to add new remote function so I have to update module.yaml file. Should I stop/start flink cluster to update module.yaml? What is true approach for use case? Updating or existing remote…
Anıl Sevici
  • 214
  • 2
  • 12
1
vote
1 answer

Flink statefun co-located functions communication

I have a properly working embedded job and I want to deploy additional co-located jobs. These newly added jobs will receive messages from the old job and send it to kafka topic. code as below @AutoService(StatefulFunctionModule.class) public final…
1
vote
1 answer

Flink Stateful Function Redeploy

I cannot find anything around versioning issues when redeploying a Flink Stateful Function. When I update and deploy code for a stateful function that has currently executing instances, what effect does that have on: Instances currently executing,…
0
votes
0 answers

How to handling completion of multiple asynchronous messages and ensuring exactly-once semantic in Flink Statefun

I'm trying to add more functionality to the example of flink-statefun-playground/java/shopping-cart and have two questions: 1.How to implement the functionality of waiting for completion of multiple asynchronous messages. For example, if…
0
votes
0 answers

Examining state in Flink Stateful Functions

Question I would like to be able to view the persisted state associated with function addresses in Flink Stateful Functions. What is the best option for achieving this? Details By "persisted state", I mean the data that StateFun passes to…
0
votes
0 answers

Flink-statefun dynamic function discovery and fan-out execution

What would be a scalable way to dynamically register and call remote-statefun? I know I can register statefun while submitting a flink job but it's not ideal to submit a new build per new function. I wonder why would flink need to know about remote…
0
votes
1 answer

Timeout issue with Flink Stateful Functions with Azure Event Hub Kafaka endpoint

Problem: Flink task manager reports: apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata Deployment overview: A Java project to try out Stateful Functions.The streaming app reads messages from Kafka, processes…
Yun Xing
  • 43
  • 4
0
votes
0 answers

How can you set the parallelism for a specific ingress for an embedded statefun application

I have a custom ingress which for various reasons should be run as a singleton. While I understand how the default parallelism can be set I do not see a way of controlling this for a specific operator or ingress when imbedded. I have searched the…
Gray
  • 3
  • 1
0
votes
0 answers

Stateful Functions Java Custom Type Protobuf

I’m trying to setup a Protobuf custom type for Java and I noticed that the Python SDK features a “make_protobuf_type” function where you call it to make that Protofile a custom type for stateful functions. What would be the Java equivalent in this…
0
votes
1 answer

Is there a way to broadcast configuration into all task managers or all FlatMapFunctions?

We currently have a flink-based streaming job (the task is composed of complex FlatMapFunctions DAG), and an http interface for fetching configuration. Now I hope to read configuration from the http interface through a source function every 5…
Medivh
  • 1
  • 3
0
votes
1 answer

How can I programmatically terminate the Statefun Harness

I'm attempting to create a cucumber testing environment for my flink stateful function application using the testing harness. I've built out the necessary wiring and step definitions to mock ingress and egress points and am now able to run nice…
Gray
  • 3
  • 1
0
votes
0 answers

How to read Kafka message header through Flink Stateful Functions in Python

Is it possible to read Kafka message header which is set in KafkaProducer application, in Flink Stateful function written in Python KafkaProducer looks like this Set
headers = Collections.singleton(new RecordHeader("is_mock_event",…
0
votes
0 answers

Set Apache Flink statefun to disable cert check for local dev

I am having issues trying to use a localstack Kinesis stream with Flink Statefun. I am getting the following error flink-compose-kinesis-master-1 | org.apache.flink.kinesis.shaded.com.amazonaws.SdkClientException: Unable to execute HTTP request:…
pocockn
  • 1,965
  • 5
  • 21
  • 36
0
votes
1 answer

Using AWS Kinesis with localstack and Apache Flink ingress

I have localstack running a mock Kinesis stream within my Docker Compose at http://localstack:4645 I am using the Flink Kinesis ingress io type to attempt to connect to the…
pocockn
  • 1,965
  • 5
  • 21
  • 36
0
votes
1 answer

Flink Statefun Under Backpressure application crashes

I'm reading data from a kafka topic which has lots of data. Once flink starts reading, it starts up fine and then crashes after some time, when backpressure hits 100%, and then goes in an endless cycle of restarts. My question is shouldn't flink's…
Singh3y
  • 336
  • 1
  • 7