CAMEL-23269: Add new component camel-camunda for Camunda 8#22338
CAMEL-23269: Add new component camel-camunda for Camunda 8#22338ibek wants to merge 5 commits intoapache:mainfrom
Conversation
|
more explanation on the context: Zeebe is deprecated https://roadmap.camunda.com/c/271-deprecate-zeebe-clients , the replacement is camunda java clients. This PR is both deprecating camel-zeebe and adding camel-camunda |
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
apupier
left a comment
There was a problem hiding this comment.
- need to add an entry in migration guide for the deprecation notice, and the replacement
- i think we need Integration Tests, the current tests are mocking almost everything
There was a problem hiding this comment.
changes to this file seems unrelated to the PR
There was a problem hiding this comment.
I can certainly revert the change but this was autogenerated when I run: mvn clean install -DskipTests
There was a problem hiding this comment.
I think you have old versions of Camel Jbang locally.
I tried and it reverts the change for me.
if we look at the history https://github.com/apache/camel/commits/main/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json , we can notice that gradle was removed for instance d316bc0
|
I tested it manually with Camunda SaaS. AFAIK we didn't even have integration tests in camel-zeebe so did at least the mocks like there. |
there are Integration tests, even if unfortunately they require to be launched locally and access an instance of Camunda. For instance https://github.com/apache/camel/blob/main/components/camel-zeebe/src/test/java/org/apache/camel/component/zeebe/ZeebeConsumerIT.java If not done within this PR, please report an issue in JIRA to implement that with TestContainer |
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of Guillaume Nodet
Good start on the new Camunda 8 component. The overall structure follows the camel-zeebe patterns well. There are a few issues to address before this can be merged.
Summary
Blocking:
- Missing
camunda-client-java-versionproperty in parent POM — build will fail - NPE risk when
variablesis null inCamundaService - Consumer
JobHandlernever completes/fails the job on the Camunda side - Unrelated changes in
camel-jbang-configuration-metadata.json(already flagged by @apupier)
Major:
5. No plaintext/TLS option for self-managed local clusters
6. No validation that operation matches endpoint type (producer vs consumer)
7. InputStream not closed in DeploymentProcessor
8. formatJSON parameter ignored in AbstractBaseProcessor.setBody()
9. All operations synchronously block with .join() — should at least be documented as a limitation
10. Test coverage gaps — no consumer tests, no processor tests
Minor:
11. JOB_KEY header labeled "producer" only but also set by consumer
12. Wrong identifier in cancel error log
13. ObjectMapper created per instance (should be shared)
14. deployResource silently ignores multi-process BPMN files
See inline comments for details.
.../camel-camunda/src/main/java/org/apache/camel/component/camunda/internal/CamundaService.java
Outdated
Show resolved
Hide resolved
components/camel-camunda/src/main/java/org/apache/camel/component/camunda/CamundaConsumer.java
Show resolved
Hide resolved
| .build()); | ||
| } | ||
|
|
||
| return builder.build(); |
There was a problem hiding this comment.
Major: When clusterId is null and no OAuth is configured (typical local Docker/dev setup), there's no way to disable TLS. The Camunda Java Client defaults to TLS, so connecting to a local non-TLS instance will fail.
The zeebe component handles this with usePlaintext(). Consider adding a usePlaintext boolean component option for self-managed setups without TLS.
components/camel-camunda/src/main/java/org/apache/camel/component/camunda/CamundaEndpoint.java
Show resolved
Hide resolved
.../camel-camunda/src/main/java/org/apache/camel/component/camunda/internal/CamundaService.java
Outdated
Show resolved
Hide resolved
components/camel-camunda/src/main/java/org/apache/camel/component/camunda/CamundaConsumer.java
Outdated
Show resolved
Hide resolved
|
|
||
| List<Process> processes = event.getProcesses(); | ||
| if (!processes.isEmpty()) { | ||
| Process process = processes.get(0); |
There was a problem hiding this comment.
Minor: If a BPMN file contains multiple processes, only the first is reported. Consider logging a warning when processes.size() > 1 so users know additional processes were deployed but not reported.
...s/camel-camunda/src/main/java/org/apache/camel/component/camunda/internal/OperationName.java
Outdated
Show resolved
Hide resolved
components/camel-camunda/src/main/java/org/apache/camel/component/camunda/CamundaConsumer.java
Outdated
Show resolved
Hide resolved
| try { | ||
| client.newCancelInstanceCommand(processMessage.getProcessInstanceKey()) | ||
| .send() | ||
| .join(); |
There was a problem hiding this comment.
I think we need to specify a configurable timeout on all the join operations. (can be one timeout for the whole component) Otherwise we can have pending processes for indefinite time. But well, maybe it is handled in another way already that I have not found as the camel-zeebe component was doing the same
and not blocking for this PR as this was already like that with zeebe but maybe worth raising an issue for that later on (unless we find how it is configured)
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc
Outdated
Show resolved
Hide resolved
oscerd
left a comment
There was a problem hiding this comment.
Review by Claude Code on behalf of Andrea Cosentino
Nice work on this new component, @ibek! The structure is clean, the documentation is thorough, and the zeebe deprecation story is well handled. A few observations:
1. (Medium) Unused formatJSON parameter in AbstractBaseProcessor.setBody()
In AbstractBaseProcessor.java, the method signature takes a boolean formatJSON parameter but the body uses endpoint.isFormatJSON() instead — the parameter is never referenced. All callers pass endpoint.isFormatJSON() anyway. Either remove the parameter or use it in the method body.
2. (Medium) Incomplete Zeebe deprecation — ZeebeConstants not annotated
@Deprecated(since = "4.19.0") was added to ZeebeComponent, ZeebeConsumer, ZeebeEndpoint, and ZeebeProducer, but ZeebeConstants (and other public classes like OperationName, model classes, processor classes) are not annotated. Since users commonly import ZeebeConstants for header names, the missing annotation means their IDE won't surface deprecation warnings.
3. (Low) Missing @Override on CamundaComponent.createEndpoint()
Minor: the overridden createEndpoint() in CamundaComponent.java is missing the @Override annotation.
4. (Low) Unrelated changes in generated catalog file
The diff for camel-jbang-configuration-metadata.json includes changes unrelated to camel-camunda (buildTool, gradleWrapper, javaVersion adding "17", jkube-maven-plugin-version downgrade). These appear to be auto-generated changes picked up during the build — could be worth splitting into a separate commit or confirming they belong here.
5. (Medium) Test coverage for processor and consumer layers
CamundaServiceTest covers all service-layer operations well, and CamundaComponentTest/CamundaEndpointTest handle basic validation. However, the processor classes (ProcessProcessor, JobProcessor, MessageProcessor, DeploymentProcessor) and CamundaConsumer are not directly tested. The JSON deserialization paths, header-based JobRequest construction, and the InputStream/byte[]/String dispatch in DeploymentProcessor would benefit from coverage.
What looks good:
- Standard component layout (direct child of
components/, proper package structure) - All BOM, parent POM, catalog, nav, component DSL, endpoint DSL updates are present
- Comprehensive docs with SaaS + self-managed modes, Java/YAML/XML examples, migration guide
- Clean zeebe deprecation: annotations, docs, upgrade guide with
xref:links - Proper
camunda-client-java-version=8.8.19in parent POM
Note: This review checks the PR against the project's conventions and guidelines. It does not replace specialized review tools (CodeRabbit, Sourcery, SonarCloud) or static analysis.
|
Thank you all. Many of the suggestions / improvements were done in the last commit. The additional improvements and provided suggestions would be implemented as part of: https://issues.apache.org/jira/browse/CAMEL-23275 I would like this PREVIEW component to be merged soonish for an upcoming university lessons (not meant for production use) - it already does what I need it for: https://github.com/ibek/pv207-camel-lab/tree/main |
|
tips: do not forget to |
|
/component-test camunda |
|
✅ |
|
the pr doc validation has failed with: @gansheer is it because it is a new component and the PR job does not handle that o there is a real problem? |
Antora makes it really challenging to have these links to a prerelease version (ie it does not work). We had a case like that a while ago (see CAMEL-22669). In the end we removed the link. |
|
Thank you @apupier , I removed those links then |
|
/component-test camunda |
|
✅ |
apupier
left a comment
There was a problem hiding this comment.
Several points to address in another round for a stable and easily maintainable code in https://issues.apache.org/jira/browse/CAMEL-23275
it's great to have the new component based on the new library
Description
This PR adds a new Camunda 8 component,
camel-camunda(support level: Preview), based on the Camunda Java Client (io.camunda:camunda-client-java).components/camel-camundawith producer + consumer supportstartProcess,cancelProcess,publishMessage,completeJob,failJob,updateJobRetries,throwError,deployResourceworker(job worker)camunda.json), DSL builders (component/endpoint DSL), Camel Main component properties, and related generated resourcescamel-zeebemetadata/docs to reflect deprecation in favor ofcamel-camundaTarget
mainbranch)Tracking
Apache Camel coding standards and style
I checked that each commit in the pull request has a meaningful subject line and body.
I have run
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.