This repo contains a sample Spring Boot application that demonstrates how to integrate with Camunda 8 using the Zeebe client. It includes examples of external service tasks and receive tasks, showcasing how to interact with the Camunda engine from a Spring Boot application.
- Default build/runtime: Java 21
- Optional fallback: Java 17 via Maven profile
java17 - Camunda 8 (Zeebe) instance running locally or remotely
- Spring Boot 3.x application with Zeebe client dependency
Download the latest - https://docs.camunda.io/docs/self-managed/quickstart/developer-quickstart/c8run/ Run:
cd c8run-8* && ./start.shInstall Camunda Modeler
- Deploy the BPMN process definition using Camunda Rest API
Request:
curl -X POST http://localhost:8080/v2/deployments \
-H "Content-Type: multipart/form-data" \
-F "resources=@./src/main/resources/order-process-v2.bpmn"Response:
{
"tenantId": "<default>",
"deploymentKey": "2251799813693661",
"deployments": [
{
"processDefinition": {
"processDefinitionId": "OrderProcessDefinition_v2",
"processDefinitionVersion": 1,
"resourceName": "order-process-v2.bpmn",
"tenantId": "<default>",
"processDefinitionKey": "2251799813693662"
}
}
]
}- Start a process using curl command
curl -X POST http://localhost:8080/v2/process-instances \
-H "Content-Type: application/json" \
-d '{
"processDefinitionId": "OrderProcessDefinition_v2",
"variables": {
"orderId": "ORDER-001"
}
}'Response:
{
"processDefinitionId": "OrderProcessDefinition_v2",
"processDefinitionVersion": 1,
"tenantId": "<default>",
"variables": {},
"processDefinitionKey": "2251799813693662",
"processInstanceKey": "2251799813695002",
"tags": []
}Endpoint: POST /api/processes/start
Start a new process instance with variables using the Java Client:
curl -X POST http://localhost:8082/api/processes/start \
-H "Content-Type: application/json" \
-d '{
"processDefinitionId": "OrderProcessDefinition_v2",
"variables": {
"orderId": "ORDER-001"
}
}'Response:
{
"processInstanceKey": 2251799813695002,
"processDefinitionId": "OrderProcessDefinition_v2",
"processDefinitionVersion": 1,
"status": "ACTIVE"
}Endpoint: POST /api/processes/publish-message
Publish a message to correlate with process instances using the Java Client:
curl -X POST http://localhost:8082/api/processes/publish-message \
-H "Content-Type: application/json" \
-d '{
"messageName": "Message_Confirmation",
"correlationKey": "ORDER-001",
"variables": {
"approvedBy": "admin"
},
"timeToLive": 300000
}'Response:
{
"messageName": "Message_Confirmation",
"correlationKey": "ORDER-001",
"status": "PUBLISHED",
"message": "Message published successfully"
}- Start process via
/api/processes/start→ Process waits at Receive Task - External service tasks execute via Job Workers (
inventoryAllocation,packingQueue,deliveryQueue) - Publish message via
/api/processes/publish-message→ Token advances and service tasks execute - On quality check success → Process completes
- On quality check failure → Manual Review user task remains active
Note: Service task execution relies on active Job Workers (see OrderProcessHandler.java). No mocking required for Job Workers in deployment.
A standalone Gatling module is available at gatling-load-tests to run a chained flow load test for:
POST /api/processes/startPOST /api/processes/publish-message
Run it with:
mvn -f gatling-load-tests/pom.xml gatling:testYou can configure request volume and timings via JVM properties, for example:
mvn -f gatling-load-tests/pom.xml gatling:test \
-Dusers=25 \
-DrampSeconds=10 \
-DpauseMillis=50See gatling-load-tests/README.md for all properties.
