akki
akki

Reputation: 451

Spring State Machine in Kubernetes Cluster

I want to run a spring state machine in an AKS cluster with multiple pods running the same application instance. The state machine is long-running. State machine configuration looks like as given below with internal state transition every X minutes and triggers state change if required conditions are met in the internal state action.

I am using state machine service along with JPA persister.

How do I ensure that the long-running state machine starts running on another pod if any one of the pod crashes or restarts ?

    transitions
            .withExternal()
            .source(S1).target(S2).event(S1_to_S2).and()
                    .withInternal().timer(Duration.ofMinutes(15)).action(a -> checkAndTriggerEvent());

enter image description here

Upvotes: 0

Views: 85

Answers (0)

Related Questions