本文介绍了使用连接工厂时,Spring State Machine超时始终执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一次,我对状态机上的超时有疑问.我的情况就是这样,参考下图

This time I have a question about timeouts on the state machine.My scenario is like this, referring to the below image

进入StateBasic时,我将执行一些操作,并且工厂给出的机器将等待WaitForTemplateResult,直到发生VAS_QRY_RES或MAIN_QRY_RES事件之一.

On entering StateBasic, I perform some action and the machine given by the Factory waits at WaitForTemplateResult till one of the events either VAS_QRY_RES or MAIN_QRY_RES.

现在还有一个超时,该超时将在30秒后触发.因此,现在发生的是即使VAS_QRY_RES或MAIN_QRY_RES出现,也会触发超时.

Now theres also a timeout which fires after 30seconds.So what happens now is the timeout is however fired even if VAS_QRY_RES or MAIN_QRY_RES comes.

我研究了这个问题,我能给出的解释是,当我第一次进入StateBasic时,StateMachineFactory分配了一个带有uuid的机器,而当VAS_QRY_RES或MAIN_QRY_RES到来时,它分配了另一台我确认是另一个uuid的机器. .无论如何,前一台计算机的超时都会触发(使用第一个uuid).

I studied this problem and the explanation I was able to render is that when I first enter the StateBasic, the StateMachineFactory allocates a machine with a uuid, and when VAS_QRY_RES or MAIN_QRY_RES comes it allocates another machine which I confirmed was a different uuid. The Timeout of the previous machine fires anyway(with the 1st uuid).

推荐答案

我希望这的根本原因在 gh321 ,我为此推送了一个修复程序.您可以尝试使用最新的1.2.3.BUILD-SNAPSHOT看看是否有帮助.

I'm hoping root cause of this was in gh321 for which I just pushed a fix. Would you mind try latest 1.2.3.BUILD-SNAPSHOT to see if it helps.

这篇关于使用连接工厂时,Spring State Machine超时始终执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 13:58