Skip to content

CAMEL-23597: camel-solr - align Exchange header prefix constants with Camel naming convention (4.14.x backport)#23489

Open
oscerd wants to merge 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23597-4.14.x
Open

CAMEL-23597: camel-solr - align Exchange header prefix constants with Camel naming convention (4.14.x backport)#23489
oscerd wants to merge 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23597-4.14.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 24, 2026

Summary

Backport to camel-4.14.x of the camel-solr Exchange header prefix alignment merged to main in #23410.

Renames the two prefix constants in SolrConstants:

  • SolrConstants.HEADER_FIELD_PREFIX value: "SolrField." -> "CamelSolrField."
  • SolrConstants.HEADER_PARAM_PREFIX value: "SolrParam." -> "CamelSolrParam."

The Java field names are unchanged, so routes referencing the constants symbolically are unaffected. Routes that set the headers by their literal string value must adopt the new prefix — documented in the 4.14 upgrade-guide entry added by this PR.

Completes the CamelSolrXxx alignment started in CAMEL-21697 (which renamed the other SolrConstants Exchange header constants but missed the two prefix constants). Consistent with the alignment applied to sibling components in CAMEL-23506, CAMEL-23522, CAMEL-23526 and CAMEL-23532. Companion of the 4.18.x backport in #23483.

What changed

  • SolrConstants.java: prefix values renamed.
  • SolrProducer.java / SolrRequestConverter.java: inline javadoc comments updated.
  • SolrInsertAndDeleteTest, SolrTestSupport: integration-test header literals updated.
  • solr-component.adoc: documentation snippets updated.
  • camel-4x-upgrade-guide-4_14.adoc: new === camel-solr entry under the 4.14.7 -> 4.14.8 section.

The comment-rename hunk in SolrPingAndSearchTest does not apply on this branch because the corresponding testQueryWithMultipleFilters test was added on main as part of CAMEL-22465 and is not present here.

Note: the canonical camel-4x-upgrade-guide-4_14.adoc on main will be updated with the same entry in a follow-up doc-sync PR, per the backport upgrade-guide policy.

Test plan

  • mvn -DskipTests formatter:format impsort:sort install in components/camel-solr — BUILD SUCCESS.
  • Cherry-pick of the main squash commit (4578a9014a6); the upgrade-guide note was redirected from the 4_21 guide to the 4_14 guide, and the testQueryWithMultipleFilters hunk in SolrPingAndSearchTest was dropped (test not present on this branch).
  • CI green.

Claude Code on behalf of Andrea Cosentino

… Camel naming convention

Rename the two prefix constants in SolrConstants (camel-solr) from
"SolrField." / "SolrParam." to "CamelSolrField." / "CamelSolrParam.",
completing the alignment started in CAMEL-21697, which renamed the other
Exchange header constants in the same file to the CamelSolrXxx convention
but missed the two prefix constants.

The Java field names (HEADER_FIELD_PREFIX, HEADER_PARAM_PREFIX) are
unchanged so routes and code that reference the constants symbolically
continue to work without changes; routes that set the headers by their
literal string value must be updated to use the new prefix value.

Updates the camel-solr integration tests, the inline comments, the
solr-component.adoc documentation, and adds a 4.14 upgrade-guide entry.
The SolrPingAndSearchTest comment-rename hunk does not apply on this
branch because the corresponding testQueryWithMultipleFilters test was
added on main as part of CAMEL-22465 and is not present here.

(cherry picked from commit 4578a90)

Reported by Claude Code on behalf of Andrea Cosentino

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd requested review from davsclaus and gnodet May 24, 2026 13:10
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.

Clean backport of the Solr header prefix alignment to `camel-4.14.x`.

What I checked:

  • Prefix renames: `HEADER_FIELD_PREFIX` (`"SolrField."` → `"CamelSolrField."`) and `HEADER_PARAM_PREFIX` (`"SolrParam."` → `"CamelSolrParam."`) correctly updated. Java field names unchanged.
  • Code comments: All inline comments in `SolrProducer.java` and `SolrRequestConverter.java` updated to reflect the new prefix names.
  • Documentation: `solr-component.adoc` examples correctly updated — INSERT operation table, XML route example, and Java `sendBodyAndHeader` examples all use the new prefixes.
  • Tests: Comprehensive update across `SolrInsertAndDeleteTest.java` and `SolrTestSupport.java` — all literal header strings migrated to `CamelSolrField.*/CamelSolrParam.*`.
  • Upgrade guide: Well-written entry in `camel-4x-upgrade-guide-4_14.adoc` with rename table, migration guidance, and the cross-transport propagation caveat.
  • No generated file changes needed: These are prefix constants (no `@Metadata` annotation), so they don't appear in the component catalog. The individually-annotated header constants already had `Camel*` prefix values.
  • `PROPERTY_ACTION_CONTEXT`: Correctly left as `"SolrActionContext"` — it's an Exchange property (not a header), so it doesn't need the `Camel` prefix and isn't subject to `HeaderFilterStrategy` filtering.

Note: a doc-sync PR to `main` will be needed for the 4.14 upgrade guide entry (per the backport-upgrade-guide policy).

LGTM.

Claude Code on behalf of Guillaume Nodet

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants