Configuring Asynchronous tasks with feedback using actors

<< Click to Display Table of Contents >>

Navigation:  Automation Server for JEE > Automation Server JEE configuration and administration > Automation Server for JEE installation > Automation Server JEE platform configuration > Setting up the system architecture >

Configuring Asynchronous tasks with feedback using actors

Overview

Service tasks can be marked as asynchronous and can be with or without feedback. When the task has the Show Feedback property enabled, the user sees a waiting page until Bizagi executes the task.

 

Nevertheless, the amount of MDB (Message-Driven Beans) threads provided by your Application Server may be not enough to meet the number of threads required per task, which causes errors and the execution of the tasks fails.

 

Therefore, when you configure Service Tasks with feedback, you need to configure Actors to process current message sharing instead of JMS. The main advantage of using actors is that the controller message is not be blocked until the worker message ends, avoiding temporal queue that generates errors. Given that Akka messages are not persistent, JMS queue is still used to avoid loss of the message that starts the flow.

 

Tuning Akka configuration

The following is the default Akka configuration for asynchronous task execution with feedback:

 

akka.actor {
  default-dispatcher{
      fork-join-executor.parallelism-factor = 1.0
  }
}
async-feedback-dispatcher{
  type = Dispatcher
  executor = "fork-join-executor"
  fork-join-executor.parallelism-min = 50
}

 

The default settings can process a high load of concurrent requests, but if you need to tune the default values follow the next procedure:

 

1. Create a file bizagi-async.conf and save it in the same directory where the bizagi-extended.properties file is located (typically located in <BIZAGI_HOME>\BizagiBPMJEE\bizagi-config).

 

2. Modify the values according to the following:

fork-join-executor.parallelism-min parameter indicates the minimum amount of threads. By default is 50. Note that that this does not work like thread pool min/max parameters.

fork-join-executor.parallelism-min and fork-join-executor.parallelism-max values are used for set bounds to the default value (fork-join-executor.parallelism-factor).

As no minimum or maximum parameters are defined, the default value is the fork-join-executor.parallelism-factor parameter where its default value is the number of processors multiplied by 2.

 

Examples

The following examples show the behavior for different configurations:

 

Example 1

Processors = 8
Default parallelism-factor = 2
Threads open = 16

 

Example 2

Processors = 8
Default parallelism-factor = 2
fork-join-executor.parallelism-min = 50
Threads open = 50

 

Example 3

Processors = 8
Default parallelism-factor = 16
fork-join-executor.parallelism-max = 10
Threads open = 10

 

Example 4

Processors = 8
fork-join-executor.parallelism-factor = 4
fork-join-executor.parallelism-min = 10
fork-join-executor.parallelism-max = 50
Threads open = 32

 

Example 5

Processors = 8
fork-join-executor.parallelism-factor = 8
fork-join-executor.parallelism-min = 10
fork-join-executor.parallelism-max = 50
Threads open = 50

 

3. When finish, restart the server to apply changes.

 

For more information about Akka, refer to https://doc.akka.io/docs/akka/current/dispatchers.html.