Flowable 6.6.0 BPMN使用者指南-(2)配置 - 2.9 作業執行器/2.10 作業執行器啟用

月滿閒庭發表於2020-12-28

《Flowable 6.6.0 BPMN使用者指南》

2. 配置

Flowable 6.6.0 使用者指南相關文件下載

精編Flowable 6.6.0 應用程式指南中文PDF版
精編Flowable 6.6.0 表單使用者指南中文PDF版

有關Flowable文件的其他資料,參見:

《Flowable文件大全》

2.9 作業執行器(Job Executor)(從6.0.0版起)

The async executor of Flowable v5 is the only available job executor in Flowable V6, as it is a more performant and more database friendly way of executing asynchronous jobs in the Flowable engine. The old job executor of Flowable 5 is no longer available in V6. More information can be found in the advanced section of the user guide.

Additionally, if running under Java EE 7, JSR-236 compliant ManagedAsyncJobExecutor can be used for letting the container manage the threads. In order to enable them, the thread factory should be passed in the configuration as follows:

Flowable V5的非同步執行器(async executor)是Flowable V6中唯一可用的作業執行器,因為它是在Flowable引擎中執行非同步作業的更高效能和資料庫更友好的方式。Flowable 5舊的作業執行器在V6中不再可用。更多資訊可在使用者指南的高階部分找到。

另外,如果執行在Java EE 7下,JSR-236相容的ManagedAsyncJobExecutor可用於讓容器管理執行緒。為了啟用ManagedAsyncJobExecutor,應該在配置中傳遞執行緒工廠(thread factory),如下所示:

<bean id="threadFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
   <property name="jndiName" value="java:jboss/ee/concurrency/factory/default" />
</bean>

<bean id="customJobExecutor" class="org.flowable.engine.impl.jobexecutor.ManagedAsyncJobExecutor">
   <!-- ... -->
   <property name="threadFactory" ref="threadFactory" />
   <!-- ... -->
</bean>

The managed implementations fall back to their default counterparts if the thread factory is not specified.

如果未指定執行緒工廠,則被管實現將返回到其預設的對應實現。

2.10 作業執行器啟用(Job executor activation)

The AsyncExecutor is a component that manages a thread pool to fire timers and other asynchronous tasks. Other implementations are possible (for example using a message queue, see the advanced section of the user guide).

By default, the AsyncExecutor is not activated and not started. With the following configuration the async executor can be started together with the Flowable Engine.

The property asyncExecutorActivate instructs the Flowable engine to start the Async executor at startup.
AsyncExecutor是一個元件(component),它管理一個執行緒池以激發定時器和其他非同步任務。也存在其他實現方式(例如使用訊息佇列,請參閱使用者指南的高階部分)。

預設情況下,AsyncExecutor不會被啟用也不會啟動。通過以下配置,非同步執行器可以與Flowable Engine一起啟動。

屬性asyncExecutorActivate指示Flowable引擎在啟動(startup)時啟動非同步執行器。

相關文章