I am using Camunda 7 (standalone engine).
I have a separate Spring Boot application that deploys BPMN files to Camunda using a Feign client and the REST API:
POST /engine-rest/deployment/create
I am sending the following flags correctly:
-
enable-duplicate-filtering = true -
deploy-changed-only = true
The following values are constant and unchanged between deployments:
-
deployment-name -
deployment-source -
tenant-id -
BPMN file name
-
BPMN file content (no changes at all)
However, Camunda always creates a new deployment, even when the BPMN file has not changed.
What works
When I call the Camunda REST API directly via Postman / curl, duplicate filtering works correctly and no new deployment is created if the file is unchanged.
What fails
When I deploy programmatically from my application using Feign + MultipartFile, Camunda always treats the deployment as new.
Relevant code (simplified)
Feign client
@PostMapping(
value = "/deployment/create",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
)
ResponseEntity<Void> createDeployment(
@RequestPart("tenant-id") String tenantId,
@RequestPart("deployment-name") String deploymentName,
@RequestPart("deployment-source") String deploymentSource,
@RequestPart("enable-duplicate-filtering") Boolean enableDuplicateFiltering,
@RequestPart("deploy-changed-only") Boolean deployChangedOnly,
@RequestPart("data") MultipartFile file
);
Reading BPMN from classpath and sending it
byte[] bytes = resource.getInputStream().readAllBytes();
MultipartFile multipartFile = new MockMultipartFile(
"data",
resource.getFilename(),
MediaType.APPLICATION_OCTET_STREAM_VALUE,
bytes
);
workflowEngine.createDeployment(multipartFile, tenantId);
Observed behavior in Camunda logs
Camunda always executes:
ENGINE-13001 Creating new deployment
ENGINE-13019 Processing resource <file>.bpmn
And the SQL query for latest resources returns no previous resources, so duplicate filtering never matches.
and in DB i check the act_ge_bytearray.bytes_ for two different deployement and are same
Question
Why does Camunda not detect the resource as unchanged when deploying via REST / Feign + MultipartFile?
Is there any known issue or requirement regarding:
-
Multipart form data
-
Resource name vs filename
-
InputStream / byte handling
-
Deployment source or deployment name
-
Feign or Spring
MockMultipartFile
What is the correct way to send BPMN files programmatically so that deploy-changed-only works as expected?
