spring-statemachine icon indicating copy to clipboard operation
spring-statemachine copied to clipboard

How to get a new fresh state machine instance which is distributed?

Open simingweng opened this issue 8 years ago • 3 comments

I'm using the @EnableStateMachineFactory annotation to expose a StateMachineFactory bean, which is backed by a ZookeeperStateMachineEnsemble bean.

It seems whatever I passed to StateMachineFactory.getStateMachine(UUID uuid) or StateMachineFactory.getStateMachine(String id), the state machine instances created were always synced with the same state, even with different UUIDs or String IDs. I couldn't find a way to create multiple distributed state machine instances, which are operated totally separately.

If I disabled distributed configuration, the multiple in-JVM state machine instances became separated.

Is the distributed state machine designed to be only globally synchronized? What I want to achieve is to create multiple groups of distributed state machines. Only the machines inside the same group shall share the same state, but each group maintain their own state independently.

Is there any other way to achieve the goal with existing API?

simingweng avatar May 25 '17 19:05 simingweng

Hmm, this feels like a bug or bad behaviour. Lemmy poke around with this a little.

jvalkeal avatar Jun 07 '17 18:06 jvalkeal

@jvalkeal any update on this?

pandey-adarsh147 avatar Nov 08 '18 18:11 pandey-adarsh147

@jvalkeal any update on this?

weiminw avatar Oct 01 '21 00:10 weiminw