I created a small camunda application with spring boot. all tasks are external.The probliem,Is I the taks do not run n parallel . just one task at a time .
And one of the tasks doenot complete until ,I close the spring boot application.
Please help
Adding the following to application.yml did not solve the problem
spring.task.execution.pool:
core-size: 10
max-size: 20
spring.task.scheduling:
pool.size: 20
example worker:
package fbs.aml.workers;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Resource;
import org.camunda.bpm.client.spring.annotation.ExternalTaskSubscription;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskHandler;
import org.camunda.bpm.client.task.ExternalTaskService;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import fbs.aml.Common;
// input : custId
// output : cusBanned, custInOfac
@Component
@ExternalTaskSubscription(“getCustomers”) // create a subscription for this topic name
public class GetCustomers implements ExternalTaskHandler {
@Resource(name = "amlDataSourceJdbcTemplate")
private JdbcTemplate jdbc;
public void execute(ExternalTask externalTask, ExternalTaskService externalTaskService) {
Logger.getLogger(“GetCustomers”).log(Level.INFO, “worker: GetCustomers started” );
String sql = "SELECT cust_i_id FROM CUSTOMERS";
List<String> customersList = jdbc.query(
sql,
(rs, rowNum) ->
new String(
rs.getString("cust_i_id")
)
);
// we could call an external service to create the loan documents here
// complete the external task
VariableMap variables = Variables.createVariables();
variables.put(Common.VAR_NAME_CUSTOMERS_LIST, customersList);
Logger.getLogger("GetCustomers").log(Level.INFO, "worker: GetCustomers finished" );
// complete the external task
externalTaskService.complete(externalTask, variables);
// externalTaskService.complete(externalTask);
Logger.getLogger(“GetCustomers”).log(Level.INFO, “worker: GetCustomers Task completed” );
}
}
spring.task.execution.pool:
core-size: 10
max-size: 20
spring.task.scheduling:
pool.size: 20
camunda.bpm.client:
base-url: http://localhost:8081/engine-rest # the URL pointing to the Camunda Platform Runtime REST API
lock-duration: 10000 # defines how many milliseconds the External Tasks are locked until they can be fetched again
subscriptions:
scoreProvider: # topic name of the External Service Task
variable-names: [] # our business logic doesn’t require any variables, so don’t fetch them
process-definition-key: loan_process # only filter for External Tasks with this process definition key
loanGranter:
variable-names: customerId, creditScore # only fetch these two variables
process-definition-key: loan_process
deleteFromBanned:
variable-names: custId
process-definition-key: processCustomerScreening
insertIntoBanned:
variable-names: custId,sanctionedId
process-definition-key: processCustomerScreening
searchById:
variable-names: custId
process-definition-key: processCustomerScreening
searchByName_7:
variable-names: custId
process-definition-key: processCustomerScreening
searchByName_8:
variable-names: custId
process-definition-key: processCustomerScreening
searchByName_9:
variable-names: custId
process-definition-key: processCustomerScreening
searchByNameNoFuzzy:
variable-names: custId
process-definition-key: processCustomerScreening
getCustInfo:
variable-names: custId
process-definition-key: processCustomerScreening
downloadOfac:
variable-names: []
process-definition-key: downloadSanctions
sanctionFromXmlToDb:
variable-names: []
process-definition-key: downloadSanctions
getCustomers:
variable-names: []
process-definition-key: mainCustomerScreening
logging.level.org.camunda.bpm.client: DEBUG # increase the log level of the application
spring:
amlDataSource:
#jdbc-url: jdbc:oracle:thin:@//192.168.1.29:1521/orcl
jdbc-url: jdbc:oracle:thin:@//localhost:1522/ora
driver.class-name: oracle.jdbc.OracleDriver
username: aml
password: aml
screening:
fileName: e:/testDownladOfac
ofacUrl: Director of PALESTINE LIBERATION FRONT - ABU ABBAS FACTION