You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Camunda 7 we utilized Spring event listeners to feed our custom monitoring tooling. Camunda 8 and spring-zebee do not provide Spring application events. Our monitoring requirement is very simple. We want to log each worker execution ( Process name, Service task elementID , input variables, result variables, result exceptions.)
We can do it today by intercepting JobWorker annotations with Aspect.
However we needed to define ActivatedJob argument in each worker to extract Service task elementId and process name. We want to keep our workers' contract simple with only required process variables. In other words, we don't want to use ActivatedJob in anywhere in our worker implementation.
Is it possible to add Spring events in JobHandlerInvokingSpringBeans?
Possible Solution
Inject ApplicationEventPublisher into JobHandlerInvokingSpringBeans.
Fire WorkerStarted, WorkerExecuted, WorkerFailed ApplicationEvents.
public class WorkerStarted extends ApplicationEvent {
private Object[] workerArgments;
private ActivatedJob activatedJob;
....
public class WorkerStarted extends ApplicationEvent {
private Object result;
private ActivatedJob activatedJob;
....
public class WorkerFailed extends ApplicationEvent {
private Exception exception; // any type of exception.
private ActivatedJob activatedJob;
....
The text was updated successfully, but these errors were encountered:
In Camunda 7 we utilized Spring event listeners to feed our custom monitoring tooling. Camunda 8 and spring-zebee do not provide Spring application events. Our monitoring requirement is very simple. We want to log each worker execution ( Process name, Service task elementID , input variables, result variables, result exceptions.)
We can do it today by intercepting JobWorker annotations with Aspect.
@around("execution(* com.priceline..*(..)) && @annotation(jobWorker)")
public void aroundExecution(final ProceedingJoinPoint joinPoint, JobWorker jobWorker)
throws Throwable {
However we needed to define ActivatedJob argument in each worker to extract Service task elementId and process name. We want to keep our workers' contract simple with only required process variables. In other words, we don't want to use ActivatedJob in anywhere in our worker implementation.
Is it possible to add Spring events in JobHandlerInvokingSpringBeans?
Possible Solution
Inject ApplicationEventPublisher into JobHandlerInvokingSpringBeans.
Fire WorkerStarted, WorkerExecuted, WorkerFailed ApplicationEvents.
public class WorkerStarted extends ApplicationEvent {
private Object[] workerArgments;
private ActivatedJob activatedJob;
....
public class WorkerStarted extends ApplicationEvent {
private Object result;
private ActivatedJob activatedJob;
....
public class WorkerFailed extends ApplicationEvent {
private Exception exception; // any type of exception.
private ActivatedJob activatedJob;
....
The text was updated successfully, but these errors were encountered: