This repository contains a spring boot demo project following the Camunda getting started guide with additional job workers to monitor custom metrics.
- OpenJDK 21+
- Maven 3
- Camunda 8 Run
- Camunda 8 Desktop Modeler
- Camunda 8 Desktop Modeler BPMN4ES plugin
- Camunda 8 Run needs to be running to launch the application.
Run the main function in DemoApplication.java or execute from the terminal:
mvn spring-boot:run
Implement the CustomMetricsEndpointInterface.java and add it to the METRIC_ENDPOINT_MAP in CustomMetricsProcessConstants.java.
Then in the bpmn model provide the correct metric type and JSON data. The function will then retrieve the metric value and return it to the Zeebe engine.
This starts a new thread on which it will poll from an endpoint while another task is ongoing. A demo implementation is commented in ChargeCreditCardWorker.java.
Instead of letting Zeebe store and manage the metric data for you (as done in the two steps options above), you can manage it yourself. This means that instead of retrieving any data, the execution listener may send a request to store the metric data under a certain task or other metadata.