How to restore a spring state machine in reactive model

Viewed 685

I am migrating a spring state machine working code to version 3.0.0 to get benefit of reactive implementation and when I call to

stateMachinePersister.restore(stateMachine, buildKey(id))

I get the error

Error restoring statemachine; block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-epoll-3

Looking in AbstractStateMachinePersister code I can see the call to block() method so how can I achieve to restore the state machine?

Edit: This happens completely aleatory, for the same request sometimes fails and sometimes work

2 Answers

Solved on Jul 27th: github.com/spring-projects/spring-statemachine/commit/…. You can use the new method resetStateMachineReactively from version 3.0.x

Related