Loading of Eventing in custom processEngine configuration

Hi, I have added @EventListener to the main class. like

@EventListener
public void onTaskEvent(DelegateTask delegateTask) {
system.out.println(“Start eventing…”)
}

but I have one AppCofig class where I am doing the configuration of processEngine like below.
@Bean
public SpringProcessEngineConfiguration processEngineConfiguration() {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(getDataSource());
config.setTransactionManager(transactionManager());
config.setDatabaseSchemaUpdate(“true”);
config.setHistory(ProcessEngineConfiguration.HISTORY_FULL);
config.setJobExecutorActivate(true);
config.setJdbcBatchProcessing(false);
return config;
}
but if I am doing so Eventing listener is not loading. on start of application I cannot find Eventing… on console log.

please help me on this

Hi,

Spring eventing is supported using an engine plugin (EventPublisherPlugin). If you create your own configuration, make sure to activate this plugin.

For example, supply the plugin as a bean:

  @Bean
  public EventPublisherPlugin myEventPublisherPlugin(CamundaBpmProperties properties, ApplicationEventPublisher publisher) {
    return new EventPublisherPlugin(properties.getEventing(), publisher);
  }

thankyou for your reply…

even after adding this to the configuration . Eventing is not activiting , check the below configuration code

@Bean
public EventPublisherPlugin myEventPublisherPlugin(CamundaBpmProperties properties, ApplicationEventPublisher publisher) {
return new EventPublisherPlugin(properties.getEventing(), publisher);
}
@Bean
public SpringProcessEngineConfiguration processEngineConfiguration() {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(getDataSource());
config.setTransactionManager(transactionManager());
config.setDatabaseSchemaUpdate(“true”);
config.setHistory(ProcessEngineConfiguration.HISTORY_FULL);
config.setJobExecutorActivate(true);
config.setJdbcBatchProcessing(false);

    return config;
}

Do you see any log statements from EVENTING? Or is is just not there (neither active nor passive)?

Is there any reason, why you are not using the AutoConfiguration but configure it on your own?

By the way, a better approach is to call the factory method, because it intializes the internal variables.

@Bean
public SpringProcessEngineConfiguration processEngineConfiguration() {
    SpringProcessEngineConfiguration config = SpringProcessEngineConfiguration.springProcessEngineConfiguration();
    config.setDataSource(getDataSource());
    config.setTransactionManager(transactionManager());
    config.setDatabaseSchemaUpdate(“true”);
    config.setHistory(ProcessEngineConfiguration.HISTORY_FULL);
    config.setJobExecutorActivate(true);
    config.setJdbcBatchProcessing(false);
    return config;
}

no I cannot see any log statements from EVENTING

to use this factory method, do we need to add any dependency to pom.xml . as compiler not able to find this SpringProcessEngineConfiguration.springProcessEngineConfiguration();

Could you please post a snippet of your pom.xml exposing the dependency to Camunda Spring Boot Starter?

Sorry, my fault, the correct config is:

SpringProcessEngineConfiguration config = CamundaSpringBootUtil.springProcessEngineConfiguration()

pom.xml–
I have attached the pom.xml file please have a look on it.
and let me know if anything need to be added or modified.
pom.xml (5.0 KB)

Were you able to resolve this issue? I have same configuration with EventPublisherPlugin bean but am not getting events…