How to configure maria db for pre packaged distribution of camunda wildfly

Hi,

I need to configure maria db for pre-packaged distribution of Camunda wildfly. Please share if any one has information.

Thanks,
Sindhu.

These database docs should help you understand what needs to be done:
https://docs.camunda.org/manual/latest/user-guide/process-engine/database/#database-configuration

1 Like

@Niall do we have equivalent Java configuration to configure datasource, transaction manager and processengine?

This would be a good place to start for that:
https://docs.camunda.org/manual/latest/user-guide/spring-framework-integration/configuration/

@Niall Im facing some issues in application startup.

ProcessEngineConfiguration looks like:

@Slf4j
public class CamundaConfig {

  @Autowired
  @Qualifier("vaultStore")
  VaultStore vaultStore;

  @Value("${ds.dbtype}")
  private String dbType;

  @Primary
  @Bean(name = "dataSource")
  public DataSource dataSource() {
    log.info("Configuring {} datasource for process engine", dbType);
    BasicDataSource dataSource = new BasicDataSource();
    dataSource.setUsername(vaultStore.getDbUserName());
    dataSource.setPassword(vaultStore.getDbPassKey());
    dataSource.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    if (dbType.equals("MYSQL") || dbType.equals("RDS")) {
      dataSource.setInitialSize(10);
      dataSource.setMaxActive(30);
      dataSource.setMinIdle(10);
      dataSource.setMaxIdle(10);
      dataSource.setMaxWait(30000);
      dataSource.setPoolPreparedStatements(true);
      dataSource.setMaxOpenPreparedStatements(30);
      dataSource.setValidationQuery("select 1");
      dataSource.setValidationQueryTimeout(3);
      dataSource.setTestOnBorrow(true);
      dataSource.setTestWhileIdle(true);
      dataSource.setRemoveAbandoned(true);
      dataSource.setRemoveAbandonedTimeout(300);
      dataSource.setMinEvictableIdleTimeMillis(3600000);
      dataSource.setTimeBetweenEvictionRunsMillis(600000);
      dataSource.setDriverClassName("com.mysql.jdbc.Driver");
      dataSource.setUrl(getMysqlURL());
    } else if (dbType.equals("H2")) {
      dataSource.setDriverClassName("org.h2.Driver");
      dataSource.setUrl(vaultStore.getDbHost());
    } else {
      log.error("DB details not configured for {}", dbType);
    }
    return dataSource;
  }

  @Bean(name = "transactionManager")
  public PlatformTransactionManager transactionManager() {    
    DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
    transactionManager.setDataSource(dataSource());
    return transactionManager;
  }

  private String getMysqlURL() {
    return new StringBuilder().append(WorkflowConstants.MYSQLDRIVER).append(vaultStore.getDbHost()).append(":")
        .append(vaultStore.getDbPort()).append("/").append(vaultStore.getDbName()).append(WorkflowConstants.MYSQLPARAMS)
        .toString();
  }

  @Bean
  public SpringProcessEngineConfiguration processEngineConfiguration() {
    SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
    config.setDataSource(dataSource());
    config.setTransactionManager(transactionManager());
    config.setDatabaseSchemaUpdate("true");
    config.setHistory("full");
    config.setJobExecutorActivate(true);
    return config;
  }

  @Bean
  public ProcessEngineFactoryBean processEngine() {
    ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
    factoryBean.setProcessEngineConfiguration(processEngineConfiguration());
    return factoryBean;
  }

  @Bean
  public RepositoryService repositoryService(ProcessEngine processEngine) {
    return processEngine.getRepositoryService();
  }

  @Bean
  public RuntimeService runtimeService(ProcessEngine processEngine) {
    return processEngine.getRuntimeService();
  }

  @Bean
  public TaskService taskService(ProcessEngine processEngine) {
    return processEngine.getTaskService();
  }

  @Bean
  public AuthorizationService authorizationService(ProcessEngine processEngine) {
    return processEngine.getAuthorizationService();
  }

  @Bean
  public DecisionService decisionService(ProcessEngine processEngine) {
    return processEngine.getDecisionService();
  }

  @Bean
  public CaseService caseService(ProcessEngine processEngine) {
    return processEngine.getCaseService();
  }

  @Bean
  public ExternalTaskService externalTaskService(ProcessEngine processEngine) {
    return processEngine.getExternalTaskService();
  }

  @Bean
  public FilterService filterService(ProcessEngine processEngine) {
    return processEngine.getFilterService();
  }

  @Bean
  public FormService formService(ProcessEngine processEngine) {
    return processEngine.getFormService();
  }

  @Bean
  public HistoryService historyService(ProcessEngine processEngine) {
    return processEngine.getHistoryService();
  }

  @Bean
  public IdentityService identityService(ProcessEngine processEngine) {
    return processEngine.getIdentityService();
  }

  @Bean
  public ManagementService managementService(ProcessEngine processEngine) {
    return processEngine.getManagementService();
  }

}

I have attached error.log file. Please let me know if iā€™m doing anything wrong.

CamundaErrLog.txt (26.5 KB)

Any solution?