Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question about persistence use #1160

Open
glmapper opened this issue Aug 23, 2024 · 0 comments
Open

A question about persistence use #1160

glmapper opened this issue Aug 23, 2024 · 0 comments
Labels
status/need-triage Team needs to triage and take a first look

Comments

@glmapper
Copy link

The code below is my state machine configuration class

@Autowired
private StateMachineRuntimePersister<States, Events, String> stateMachineRuntimePersister;

@Override
public void configure(StateMachineConfigurationConfigurer<States, Events> config) throws Exception {
    config.withPersistence().runtimePersister(stateMachineRuntimePersister);
    // set machineId or not?
    config.withConfiguration().machineId("orderStateMachine").autoStartup(true);
}

stateMachineRuntimePersister instance type is MongoDbPersistingStateMachineInterceptor。

The questions and doubts I have are:

  • If 'machineId' is specified, then the persistence will be based on 'machineId' as the query key, resulting in multiple order state machines sharing a persistent state machine, thus influencing each other.
  • If 'machineId' is not specified, a null pointer exception is thrown.

image

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-triage Team needs to triage and take a first look
Projects
None yet
Development

No branches or pull requests

1 participant