重启后 wso2 等待循环不起作用 [英] wso2 wait loop doesn't work after restart

查看:18
本文介绍了重启后 wso2 等待循环不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在连接到 Postgresql 9 DB 的 WSO2 BPS 3.0.0 上的 bpel 进程中开发了一个池逻辑.它看起来像这样:

I've developed a pooling logic in bpel process on the WSO2 BPS 3.0.0 connected to a Postgresql 9 DB. It looks like this:

<bpel:repeatUntil name="RepeatUntilIncidentCompleted">
<bpel:sequence name="CheckIncidentStatus">
    <bpel:wait name="Wait">
        <bpel:for expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA['PT1M']]></bpel:for>
    </bpel:wait>
    <!-- invoke a service, copy status to a vStatus variable -->
</bpel:sequence>
<bpel:condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[$vStatus=36]]></bpel:condition>

我创建了一个流程实例,这个循环运行良好.后来我重新启动了 WSO2 BPS 服务器.在重新启动的那一刻,流程实例处于循环中,但重新启动后循环不再运行.该进程在 carbon 控制台中被标记为活动状态.

I created a process instance and this loop worked fine. Later I restarted the WSO2 BPS server. In the moment of the restart the process instance was in the loop, but after restart the loop wasn't running anymore. The process is marked as active in the carbon console.

我在 deploy.xml 中添加了 in-memory=false 属性,但没有帮助.

I've added the in-memory=false property in the deploy.xml but it didn't help.

我可能错过了一些配置,但这样的循环也可能存在持久性问题(可能在 Apache ODE 中).

I could have missed some configuration but there also can be a persistence problem with such a loop (probably in the Apache ODE).

有人知道这个问题的解决方案吗?提前谢谢.

Does anyone know a solution to this problem? Thx in advance.

推荐答案

我发现:
1. 您放入 wso2 bpel 进程的所有睡眠操作都在 ode_job 表中表示.ts 属性包含唤醒时间.
2. bps服务器重启后,所有延迟的睡眠操作都不再继续(当唤醒时间<当前时间-偏移量时,睡眠操作被延迟).
3. bps 服务器重启后,所有非延迟睡眠操作都正常继续.

I've discovered that:
1. All sleep operations that you put in a wso2 bpel process are represented in the ode_job table. The attribute ts contains the time of wake up.
2. After restart of the bps server all delayed sleep operations aren't continued (a sleep operation is delayed when wake up time < current time - offset ).
3. After restart of the bps server all non-delayed sleep operations that are continued properly.

现在让我们这样说:
- 您有一个在等待操作中等待的 bpel 流程实例.起床时间为 X.
- 你停止 bps 服务器,然后在 X 之后重新启动它.
因为2.重启后流程实例不会继续.这包括我之前描述的循环.

我对这个问题的解决方法:
每次重新启动 wso2 bps 服务器时,我都会在数据库上执行一个 sql 脚本,该脚本会更新睡眠操作的唤醒属性(ode_job 表中的 ts 列).起床时间设置在不久的将来.

我不知道你是否可以通过配置更改 2./3. 行为.我找不到任何关于它的文档.这里需要一些代码分析.更糟糕的是,wso2 使用它自己的 apache ode 分支,所以你不能只更新 apache ode 库.

我怀疑 2.:
中描述的行为可能有两个原因- 延迟睡眠操作被删除
- 延迟睡眠操作在重启后立即执行,但尚未加载进程定义.

Now let's say that:
- You have a bpel process instance that waits in a wait operation. The wake up time is X.
- You stop the bps server, and start it again after X.
Because of 2. the process instance won't continue after restart. This includes the loop I've described earlier.

My workaround to the problem:
Everytime the wso2 bps server is restarted I execute a sql script on the database that updates the wake up attribute of the sleep operations (the ts column in the ode_job table). The wake up times are set to some near future.

I don't know if you can change the 2. / 3. behaviour by configuration. I couldn't find any documentation about it. Some code analasis is needed here. To make things worse, wso2 uses it's own apache ode branch, so you can't just update the apache ode library.

I suspect that there can be two reasons for the behaviour described in 2.:
- delayed sleep operations are droped
- delayed sleep operations are executed right after restart, but the process definitions aren't loaded yet.

这篇关于重启后 wso2 等待循环不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆