fix(ops): 修复改为分步构建责任链-不构建队列bug
This commit is contained in:
@@ -81,10 +81,10 @@ public class OrderLifecycleManagerImpl implements OrderLifecycleManager {
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 构建责任链
|
||||
responsibilityChain = stateTransitionHandler
|
||||
.setNext(queueSyncHandler)
|
||||
.setNext(eventPublishHandler);
|
||||
// 构建责任链(分步构建,避免 setNext 返回 this 导致的链式调用问题)
|
||||
stateTransitionHandler.setNext(queueSyncHandler);
|
||||
queueSyncHandler.setNext(eventPublishHandler);
|
||||
responsibilityChain = stateTransitionHandler;
|
||||
|
||||
log.info("生命周期管理器责任链已构建: StateTransitionHandler -> QueueSyncHandler -> EventPublishHandler");
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class TransitionHandler {
|
||||
protected TransitionHandler next;
|
||||
|
||||
/**
|
||||
* 设置<EFBFBD><EFBFBD><EFBFBD>一个处理器
|
||||
* 设置下一个处理器
|
||||
*
|
||||
* @param next 下一个处理器
|
||||
* @return this
|
||||
|
||||
Reference in New Issue
Block a user