Skip to content

CAMEL-22857 Jackson 3 components : camel-jackson3, camel-jackson3-avro, camel-jackson3-protobuf, camel-jackson3xml#21644

Merged
davsclaus merged 4 commits intoapache:mainfrom
cunningt:CAMEL-22857-1
Mar 5, 2026
Merged

CAMEL-22857 Jackson 3 components : camel-jackson3, camel-jackson3-avro, camel-jackson3-protobuf, camel-jackson3xml#21644
davsclaus merged 4 commits intoapache:mainfrom
cunningt:CAMEL-22857-1

Conversation

@cunningt
Copy link
Contributor

@cunningt cunningt commented Feb 27, 2026

Description

https://issues.apache.org/jira/browse/CAMEL-22857

There are four jackson components in camel : camel-jackson, camel-jackson-avro, camel-jackson-protobuf, camel-jacksonxml. Introduce Jackson 3 versions of these components that use the Jackson 3 API.

camel-jackson3: JSON support with Jackson 3
camel-jackson3-avro: Avro support with Jackson 3
camel-jackson3-protobuf: Protobuf support with Jackson 3
camel-jackson3xml: XML support with Jackson 3

edit March 2 2026 : DSL and transformer names are now shared with the camel-jackson 2 components and we select the component to use based on which package name the ObjectMapper has on the classpath in DefaultTransformerResolver.java and DefaultDataFormatResolver.java. The catalog presents a challenge - we're skipping the jackson3 components in listing the transformers .

Target

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

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

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.

@github-actions
Copy link
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.

@cunningt
Copy link
Contributor Author

I see the PR doc validation error and will submit changes fixing them Monday.

@davsclaus
Copy link
Contributor

I dont like we have duplicate DSLs. As an end user you would only use either Jackson 2 or 3 not both at the same time.

So what we should look at is to make Camel attempt to load jackson3 if available and if not jackson2 and then keep the DSL as is.

The DSL in Camel is big and verbose, we should avoid expanding this - especially because of a implementation detail of the jackson library upgraded under the hood.

There is the DataFormatResolver that attempt to discover the library - that code can be improved to be able to detect jackson 3 and 2.

See DefaultDataFormatResolver and its okay to add hardcoded code that says "jackson" then try "jackson3" first and if not found then fallback to as before.

@davsclaus
Copy link
Contributor

And ditto for the DefaultTransformerResolver

@cunningt
Copy link
Contributor Author

cunningt commented Mar 2, 2026

And ditto for the DefaultTransformerResolver

I think this is doable (and the DSL) but I think I'm going to need some help to prevent collisions in the generated docs between camel-jackson / camel-jackson3 - are there any other situations where two components have shared a DSL name or Transformer name?

@davsclaus
Copy link
Contributor

I dont think we need need docs, lets try to make it a different JAR and nothing else. We know that jackson2 is eventually going to be dropped later when all the ducks are aligned.

@cunningt cunningt force-pushed the CAMEL-22857-1 branch 2 times, most recently from f965e90 to 2d6e892 Compare March 2, 2026 23:18
@cunningt
Copy link
Contributor Author

cunningt commented Mar 3, 2026

I'm having some trouble figuring out the CI error here - is the error on "cat: target/it/HeaderSupport/build.log: No such file or directory"? I don't think I've changed anything in that area?

@davsclaus
Copy link
Contributor

I think its some old stuff for the camel-archetype-api-component when its used for creating a new api based component, then there is something that creates a sample project and some groovy stuff verify

@davsclaus
Copy link
Contributor

see tooling/maven/camel-package-maven-plugin/pom.xml this can maybe help you

@davsclaus
Copy link
Contributor

I wonder if there is a reason why there is a new Jackson3DataFormat in the model classes of camel ?

Ideally we can use the existing jackson data format model, and then the data format resolver will load jackson 3.x if its on the classpath (as you already have done).

We have not added new exclusive options in the dataformat that are new in jackson 3.x only and not available in 2.x ?

In other words if the DSL is unchanged or as little changed the better.

@davsclaus
Copy link
Contributor

Great work Tom we are almost there

@cunningt
Copy link
Contributor Author

cunningt commented Mar 4, 2026

@davsclaus Can you point me to the Jackson3DataFormat ? I'm having trouble finding it locally - I think we need a org.apache.camel.component.jackson.JacksonDataFormat and a org.apache.camel.component.jackson3.JacksonDataFormat because of the com.fasterxml.* vs tools.jackson.* package name changes of imported classes (ObjectMapper in particular) but I'm not sure that's what we're talking about.

@cunningt
Copy link
Contributor Author

cunningt commented Mar 4, 2026

I think I found it, jackson3Xml looks like it is left over from before the resolver changes, removing and testing.

@davsclaus
Copy link
Contributor

yeah it smells like a left over. You can also run the full regen script from the etc folder

@davsclaus
Copy link
Contributor

Run [[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; echo; echo; git diff; exit 1; }
There are uncommitted changes
HEAD detached at pull/21644/merge
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/seda.json
modified: catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/stub.json
modified: dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SedaEndpointBuilderFactory.java
modified: dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StubEndpointBuilderFactory.java

@cunningt
Copy link
Contributor Author

cunningt commented Mar 4, 2026

Weird - I've built locally twice and have nothing uncommited. Rebased and trying again.

@davsclaus
Copy link
Contributor

yeah it may also even be on main branch itself

@davsclaus
Copy link
Contributor

you can rebase main as there were some unmodified files that needed regen

I dont dare do the regen on your behalf as this is a big PR and maybe something goes wrong

cunningt added 4 commits March 4, 2026 17:00
- camel-jackson3: JSON support with Jackson 3
- camel-jackson3-avro: Avro support with Jackson 3
- camel-jackson3-protobuf: Protobuf support with Jackson 3
- camel-jackson3xml: XML support with Jackson 3
…s passed skip the exec step in camel-package-maven-plugin (there will be no log to process) to prevent CI test failures
@davsclaus
Copy link
Contributor

LGTM

@davsclaus davsclaus merged commit ef045fb into apache:main Mar 5, 2026
4 checks passed
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.

2 participants