Andrea Cosentino created CAMEL-23577:
----------------------------------------

             Summary: align Exchange header constant names with Camel naming 
convention - global sweep
                 Key: CAMEL-23577
                 URL: https://issues.apache.org/jira/browse/CAMEL-23577
             Project: Camel
          Issue Type: Improvement
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.21.0


Tracking ticket for a project-wide consistency sweep aligning producer-side 
Exchange header constant *values* with the {{Camel<Component>*}} naming 
convention, following the pattern established in CAMEL-23526 ({{camel-cxf}}), 
CAMEL-23461 ({{camel-aws-bedrock}}), CAMEL-23522 ({{camel-mail}} JavaMail 
session properties), CAMEL-23532 ({{camel-vertx-websocket}} / 
{{camel-atmosphere-websocket}} / {{camel-iggy}}), CAMEL-23515 ({{camel-nats}}), 
CAMEL-23516 ({{camel-xmpp}}), and CAMEL-23576 ({{camel-jira}}).

h3. Why

The default {{HeaderFilterStrategy}} ({{DefaultHeaderFilterStrategy}}) filters 
the {{Camel*}} / {{org.apache.camel.*}} namespace case-insensitively at 
transport boundaries. Producer-side header constants that drive *dispatch* 
(operation, target resource identifier, action) but whose string value is not 
in that namespace cannot benefit from this default filter, and route-author 
migration is more friction-prone than necessary. Renaming constant *values* to 
{{Camel<Component>*}} while keeping the Java field names unchanged makes the 
symbolic reference path migration-free; only routes using literal string values 
need adjustment, documented in the upgrade guide.

h3. Fix shape

For each component:

* Rename the *string value* of each producer-read header constant to 
{{Camel<Component><Name>}}; keep the Java field name unchanged.
* Producers continue to compile and run without change.
* Update tests that use the literal string values.
* Add an upgrade-guide entry in 
{{docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc}} (and 
matching 4_18 / 4_14 for backports where the component existed in those 
branches).
* Re-generate component catalog JSON and docs.

An alternative fix shape, used by CAMEL-23532, is to introduce a dedicated 
{{HeaderFilterStrategy}} that filters the legacy values on inbound and rely on 
routes carrying a transformed header at the trust boundary. This is preferable 
when the legacy values are part of an externally-visible protocol contract 
(e.g. {{websocket.connectionKey}} in {{camel-undertow}}).

h3. Sub-tasks (priority order)

*Cluster A - auth / credential / signing exposure (urgent):*
* {{camel-shiro}} - SHIRO_SECURITY_USERNAME / SHIRO_SECURITY_PASSWORD / 
SHIRO_SECURITY_TOKEN
* {{camel-web3j}} - FROM_ADDRESS / TO_ADDRESS / VALUE / SIGNED_TRANSACTION_DATA 
/ SHA3_HASH_OF_DATA_TO_SIGN / OPERATION + ~25 more RPC argument headers
* {{camel-pdf}} - DECRYPTION_MATERIAL_HEADER_NAME / 
PROTECTION_POLICY_HEADER_NAME / PDF_DOCUMENT_HEADER_NAME / 
FILES_TO_MERGE_HEADER_NAME

*Cluster B - OpenStack family:*
* {{camel-openstack}} - OPERATION / ID / NAME / PASSWORD / ADMIN_PASSWORD / 
ACTION and all resource-identifier headers across keystone, nova, cinder, 
glance, neutron, swift

*Cluster C - search engines (paired):*
* {{camel-elasticsearch}} + {{camel-opensearch}} - PARAM_OPERATION / 
PARAM_INDEX_ID / PARAM_INDEX_NAME / PARAM_DOCUMENT_CLASS / PARAM_DOCUMENT_MODE 
/ PARAM_WAIT_FOR_ACTIVE_SHARDS / PARAM_SCROLL / PARAM_SIZE / PARAM_FROM

*Cluster D - GitHub (paired):*
* {{camel-github}} + {{camel-github2}} - GITHUB_PULLREQUEST / 
GITHUB_INRESPONSETO / GITHUB_PULLREQUEST_HEAD_COMMIT_SHA / GITHUB_ISSUE_TITLE

*Cluster E - Google cloud APIs:*
* {{camel-google-functions}} / {{camel-google-secret-manager}} / 
{{camel-google-vision}} / {{camel-google-text-to-speech}} / 
{{camel-google-speech-to-text}} - OPERATION and deploy-side controls 
(ENTRY_POINT, RUNTIME, SOURCE_ARCHIVE_URL in functions)

*Cluster F - miscellaneous data stores:*
* {{camel-kafka}} - kafka.OVERRIDE_TOPIC / kafka.KEY / kafka.PARTITION_KEY / 
kafka.OVERRIDE_TIMESTAMP
* {{camel-arangodb}} - ARANGO_KEY / RESULT_CLASS_TYPE
* {{camel-mongodb-gridfs}} - GRIDFS_OPERATION / GRIDFS_OBJECT_ID / 
GRIDFS_METADATA / GRIDFS_CHUNKSIZE
* {{camel-jt400}} - KEY for keyed-data-queue write

*Cluster G - undertow websocket (CAMEL-23532 follow-on):*
* {{camel-undertow}} - websocket.connectionKey / websocket.connectionKey.list / 
websocket.sendToAll

*Cluster H - Solr prefix iterate-and-trust:*
* {{camel-solr}} - SolrField. / SolrParam. prefixes

*Cluster I - low priority:*
* {{camel-milo}} - HEADER_AWAIT
* {{camel-mail}} - delete / moveTo / copyTo consumer-side dispatch (companion 
to CAMEL-23522)

h3. Reference precedents

* CAMEL-23526 (camel-cxf): renamed constant values, Java fields unchanged
* CAMEL-23532 (camel-vertx-websocket / camel-atmosphere-websocket / 
camel-iggy): added a dedicated HeaderFilterStrategy aligned with sibling 
components
* CAMEL-23522 (camel-mail): gated risky-property mapping behind opt-in
* CAMEL-23461 (camel-aws-bedrock): renamed one header value
* CAMEL-23515 ({{camel-nats}}), CAMEL-23516 ({{camel-xmpp}}): dedicated 
HeaderFilterStrategy approach

h3. Backport policy

Defects in this family predate 4.x. Each sub-task should consider backports to 
{{camel-4.18.x}} and {{camel-4.14.x}} where the component exists on those 
branches. Backport decisions are recorded on the per-component sub-tasks rather 
than on this tracker.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to