Skip to content

[backport camel-4.18.x] CAMEL-23581: camel-elasticsearch + camel-opensearch - align Exchange header constant names with Camel naming convention#23538

Merged
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23442-to-camel-4.18.x
May 27, 2026
Merged

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 26, 2026

Backports #23442 to camel-4.18.x.

Cherry-pick of merge commit 70d9e92ee03 with one adaptation: the original
PR's upgrade-guide entry was added to camel-4x-upgrade-guide-4_21.adoc,
which does not exist on the 4.18.x maintenance branch. Per the project's
backport policy the same content has been added to
camel-4x-upgrade-guide-4_18.adoc instead.

Summary

Renames the PARAM_* Exchange header string values in ElasticsearchConstants
and OpensearchConstants that were not in the Camel namespace to
CamelElasticsearch* / CamelOpensearch* respectively.

10 constants renamed in ElasticsearchConstants (PARAM_OPERATION,
PARAM_INDEX_ID, PARAM_INDEX_NAME, PARAM_DOCUMENT_CLASS,
PARAM_WAIT_FOR_ACTIVE_SHARDS, PARAM_SCROLL_KEEP_ALIVE_MS, PARAM_SCROLL,
PARAM_SIZE, PARAM_FROM, PARAM_DOCUMENT_MODE); 9 constants renamed in
OpensearchConstants (same minus PARAM_DOCUMENT_MODE, which only exists in
ElasticsearchConstants).

The Java field names are unchanged so routes referencing the constants
symbolically continue to work; routes using the literal string values must be
updated. PROPERTY_SCROLL_ES_QUERY_COUNT /
PROPERTY_SCROLL_OPENSEARCH_QUERY_COUNT were already Camel-prefixed and
are unchanged.

DSL accessors renamed accordingly: operation()elasticsearchOperation()
/ opensearchOperation(), indexId()elasticsearchIndexId() /
opensearchIndexId(), etc.

Test plan

  • mvn test in components/camel-elasticsearch on 4.18.x — BUILD SUCCESS
  • mvn test in components/camel-opensearch on 4.18.x — BUILD SUCCESS
  • Cherry-pick applied cleanly except for the 4_21 → 4_18 guide-file
    rename described above (no merge marker shipped)
  • Upgrade-guide entry added under
    === camel-elasticsearch / camel-opensearch - potential breaking change
    in camel-4x-upgrade-guide-4_18.adoc

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

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.

Standard header rename backport for camel-elasticsearch and camel-opensearch to 4.18.x. Renames headers from short names (e.g., operation, indexId, indexName) to Camel-prefixed names (e.g., CamelElasticsearchOperation, CamelElasticsearchIndexId). Both components follow the same pattern. Upgrade guide entry included. Bulk of the diff is generated catalog metadata.

LGTM.

Fully automatic review from Claude Code

@oscerd oscerd force-pushed the backport/23442-to-camel-4.18.x branch 4 times, most recently from 4e17268 to 4f0cef6 Compare May 27, 2026 08:23
…header constant names with Camel naming convention (apache#23442)

Renames the Exchange header string values in ElasticsearchConstants and
OpensearchConstants from non-Camel prefixed values (operation, indexId,
indexName, documentClass, waitForActiveShards, scrollKeepAliveMs,
useScroll, size, from, enableDocumentOnlyMode) to CamelElasticsearch* /
CamelOpensearch*, following the convention used across the rest of the
Camel component catalog and matching the pattern established in
CAMEL-23526 (camel-cxf), CAMEL-23522 (camel-mail), CAMEL-23461
(camel-aws-bedrock), CAMEL-23532 (camel-vertx-websocket /
camel-atmosphere-websocket / camel-iggy), and CAMEL-23576 (camel-jira).

The Java field names (PARAM_OPERATION, PARAM_INDEX_ID, PARAM_INDEX_NAME,
PARAM_DOCUMENT_CLASS, PARAM_WAIT_FOR_ACTIVE_SHARDS,
PARAM_SCROLL_KEEP_ALIVE_MS, PARAM_SCROLL, PARAM_SIZE, PARAM_FROM,
PARAM_DOCUMENT_MODE) are unchanged so routes referencing the constants
symbolically continue to work; routes using the literal string values
must be updated (documented in the 4.21 upgrade guide).

The already-Camel-prefixed PROPERTY_SCROLL_ES_QUERY_COUNT and
PROPERTY_SCROLL_OPENSEARCH_QUERY_COUNT constants are unchanged.

The generated Endpoint DSL header accessors on
ElasticsearchHeaderNameBuilder and OpensearchHeaderNameBuilder have been
renamed accordingly (operation() -> elasticsearchOperation() /
opensearchOperation(), indexId() -> elasticsearchIndexId() /
opensearchIndexId(), etc.).

All existing tests use symbolic constant references and continue to pass
without changes.

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd force-pushed the backport/23442-to-camel-4.18.x branch from 4f0cef6 to bebf70f Compare May 27, 2026 08:24
@oscerd oscerd merged commit 9ed63f8 into apache:camel-4.18.x May 27, 2026
3 checks passed
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.

3 participants