按照官方文档写的文档,编写的调试代码 如下 ,为什么@SagaTask 标注的方法在@saga 方法执行之后没有执行呢 ?
@Transactional
@Saga(code = “create-user”, description = “创建用户”, inputSchemaClass = TestUser.class)
@GetMapping("/startTestSaga")
public void testSaga(){
log.info("*********** testSaga…");
TestUser testUser = TestUser.builder().userName(“zhangsan”).password(“123456”).build();
StartInstance startInstance = StartInstance.builder()
.sagaCode(“create-user”)
.input(JSON.toJSONString(testUser))
.uuid(“82384f2b5c1b4f519287fc9dbd1a5b67”)
.service(“choerodon-asgard”).level(“user”).build()
;
sagaInstanceService.start(startInstance);
}
@SagaTask(code = "create-user",
description = "创建用户",
sagaCode = "create-user",
concurrentLimitNum = 2,
concurrentLimitPolicy = SagaDefinition.ConcurrentLimitPolicy.NONE,
seq = 1)
public void createUser(String data){
TestUser testUser = JSON.parseObject(data, TestUser.class);
log.info("**************** user name = {}",testUser.getUserName());
}