Skip to content

CAMEL-23269: Add new component camel-camunda for Camunda 8#22338

Open
ibek wants to merge 5 commits intoapache:mainfrom
ibek:camel-camunda
Open

CAMEL-23269: Add new component camel-camunda for Camunda 8#22338
ibek wants to merge 5 commits intoapache:mainfrom
ibek:camel-camunda

Conversation

@ibek
Copy link
Copy Markdown
Contributor

@ibek ibek commented Mar 30, 2026

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).

  • New component: components/camel-camunda with producer + consumer support
    • Producer operations: startProcess, cancelProcess, publishMessage, completeJob, failJob, updateJobRetries, throwError, deployResource
    • Consumer operation: worker (job worker)
  • Documentation: new component docs and examples, plus docs site navigation entry
  • Generated/catalog updates: component metadata (camunda.json), DSL builders (component/endpoint DSL), Camel Main component properties, and related generated resources
  • Deprecation alignment: updates camel-zeebe metadata/docs to reflect deprecation in favor of camel-camunda

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

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 -DskipTests locally from root folder and I have committed all auto-generated changes.

@apupier
Copy link
Copy Markdown
Contributor

apupier commented Mar 30, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Copy link
Copy Markdown
Contributor

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes to this file seems unrelated to the PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly revert the change but this was autogenerated when I run: mvn clean install -DskipTests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ibek
Copy link
Copy Markdown
Contributor Author

ibek commented Mar 30, 2026

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.

@apupier
Copy link
Copy Markdown
Contributor

apupier commented Mar 30, 2026

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

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Missing camunda-client-java-version property in parent POM — build will fail
  2. NPE risk when variables is null in CamundaService
  3. Consumer JobHandler never completes/fails the job on the Camunda side
  4. 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.

.build());
}

return builder.build();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


List<Process> processes = event.getProcesses();
if (!processes.isEmpty()) {
Process process = processes.get(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

try {
client.newCancelInstanceCommand(processMessage.getProcessInstanceKey())
.send()
.join();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.19 in 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.

@ibek
Copy link
Copy Markdown
Contributor Author

ibek commented Mar 31, 2026

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

@apupier
Copy link
Copy Markdown
Contributor

apupier commented Mar 31, 2026

tips: do not forget to re-request review when you like to have another round of review and feedback were addressed/discussed/rejected so that it becomes visible to the dashboards of the reviewers

@apupier apupier requested review from apupier, gnodet and oscerd March 31, 2026 14:44
@apupier
Copy link
Copy Markdown
Contributor

apupier commented Mar 31, 2026

/component-test camunda

@github-actions
Copy link
Copy Markdown
Contributor

/component-test camunda tests passed successfully.

@apupier
Copy link
Copy Markdown
Contributor

apupier commented Mar 31, 2026

the pr doc validation has failed with:

 [15:06:46.903] ERROR (asciidoctor): target of xref not found: components::camunda-component.adoc
    file: /home/runner/work/camel/camel/camel/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/user-manual)
[15:06:46.907] ERROR (asciidoctor): target of xref not found: components::camunda-component.adoc
    file: /home/runner/work/camel/camel/camel/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/user-manual)
[15:07:05.548] WARN (asciidoctor): 
    file: /home/runner/work/camel/camel/camel/docs/components/modules/ROOT/pages/camunda-component.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/components)
    msg: {
      "msg": "Target spring-boot:example$json/camunda.json not found",
      "useId": 7,
      "jsonpath": "jsonpathcount$"
    }

@gansheer is it because it is a new component and the PR job does not handle that o there is a real problem?

@gansheer
Copy link
Copy Markdown
Contributor

gansheer commented Mar 31, 2026

the pr doc validation has failed with:

 [15:06:46.903] ERROR (asciidoctor): target of xref not found: components::camunda-component.adoc
    file: /home/runner/work/camel/camel/camel/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/user-manual)
[15:06:46.907] ERROR (asciidoctor): target of xref not found: components::camunda-component.adoc
    file: /home/runner/work/camel/camel/camel/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_19.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/user-manual)
[15:07:05.548] WARN (asciidoctor): 
    file: /home/runner/work/camel/camel/camel/docs/components/modules/ROOT/pages/camunda-component.adoc
    source: /home/runner/work/camel/camel/camel (branch: HEAD <worktree> | start path: docs/components)
    msg: {
      "msg": "Target spring-boot:example$json/camunda.json not found",
      "useId": 7,
      "jsonpath": "jsonpathcount$"
    }

@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.

Copy link
Copy Markdown
Contributor

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least the build failure related to doc must be handled. Based on comment from @gansheer I recommend to remove it unfortunately.

@ibek
Copy link
Copy Markdown
Contributor Author

ibek commented Apr 1, 2026

Thank you @apupier , I removed those links then

@ibek
Copy link
Copy Markdown
Contributor Author

ibek commented Apr 1, 2026

/component-test camunda

@ibek ibek requested a review from apupier April 1, 2026 09:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

/component-test camunda tests passed successfully.

Copy link
Copy Markdown
Contributor

@apupier apupier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants