Skip to content

CAMEL-24169: Schema resolver latches first resolved schema forever (4.18.x) - #24922

Merged
davsclaus merged 1 commit into
camel-4.18.xfrom
fix/CAMEL-24169-4.18.x
Jul 20, 2026
Merged

CAMEL-24169: Schema resolver latches first resolved schema forever (4.18.x)#24922
davsclaus merged 1 commit into
camel-4.18.xfrom
fix/CAMEL-24169-4.18.x

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Summary

Backport of #24921 to 4.18.x.

  • Fix AvroSchemaResolver and ProtobufSchemaResolver unconditionally promoting dynamically resolved schemas into the this.schema instance field
  • After the first exchange resolves a schema, the per-type schemes ConcurrentMap becomes dead code — every subsequent exchange short-circuits to the latched schema regardless of body type or per-exchange properties
  • The fix removes the this.schema = answer latch from computeIfAbsent() so this.schema is only authoritative when explicitly set via setSchema()
  • jackson3 variants don't exist on 4.18.x

Test plan

  • Cherry-picked cleanly (jackson3 files excluded — not present on this branch)
  • mvn verify in camel-jackson-avro and camel-jackson-protobuf

Claude Code on behalf of davsclaus

…reaking multi-type routes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>

@gnodet gnodet left a comment

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.

Clean backport of #24921 to 4.18.x. Same fix — removing the this.schema = answer latch from computeIfAbsent() — correctly scoped to the 2 resolvers that exist on this branch (jackson3 variants don't exist on 4.18.x).

Cherry-pick is straightforward — the affected code is identical between branches.

LGTM ✅

Claude Code on behalf of gnodet — AI-generated review

@davsclaus davsclaus added this to the 4.18.4 milestone Jul 20, 2026
@davsclaus davsclaus added the bug Something isn't working label Jul 20, 2026
@davsclaus davsclaus self-assigned this Jul 20, 2026
@davsclaus
davsclaus merged commit d440bb9 into camel-4.18.x Jul 20, 2026
3 checks passed
@davsclaus
davsclaus deleted the fix/CAMEL-24169-4.18.x branch July 20, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants