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
Open
Conversation
… 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>
gnodet
approved these changes
May 24, 2026
Contributor
gnodet
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport to
camel-4.14.xof thecamel-solrExchange header prefix alignment merged tomainin #23410.Renames the two prefix constants in
SolrConstants:SolrConstants.HEADER_FIELD_PREFIXvalue:"SolrField."->"CamelSolrField."SolrConstants.HEADER_PARAM_PREFIXvalue:"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
CamelSolrXxxalignment started in CAMEL-21697 (which renamed the otherSolrConstantsExchange 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-solrentry under the 4.14.7 -> 4.14.8 section.The comment-rename hunk in
SolrPingAndSearchTestdoes not apply on this branch because the correspondingtestQueryWithMultipleFilterstest was added onmainas part of CAMEL-22465 and is not present here.Test plan
mvn -DskipTests formatter:format impsort:sort installincomponents/camel-solr— BUILD SUCCESS.mainsquash commit (4578a9014a6); the upgrade-guide note was redirected from the4_21guide to the4_14guide, and thetestQueryWithMultipleFiltershunk inSolrPingAndSearchTestwas dropped (test not present on this branch).Claude Code on behalf of Andrea Cosentino