You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/05/28 14:35:24 UTC

[PR] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention [camel]

oscerd opened a new pull request, #23602:
URL: https://github.com/apache/camel/pull/23602

   ## Summary
   
   Renames the Exchange header string values in `KafkaConstants` from the non-Camel-prefixed `kafka.*` namespace to the project-wide `CamelKafka*` PascalCase convention, completing the camel-kafka sub-task under the [CAMEL-23577](https://issues.apache.org/jira/browse/CAMEL-23577) umbrella header-naming-convention sweep.
   
   ### Rename table
   
   | Constant | Previous value | New value |
   |----------|---------------|-----------|
   | `KafkaConstants.PARTITION_KEY` | `kafka.PARTITION_KEY` | `CamelKafkaPartitionKey` |
   | `KafkaConstants.PARTITION` | `kafka.PARTITION` | `CamelKafkaPartition` |
   | `KafkaConstants.KEY` | `kafka.KEY` | `CamelKafkaKey` |
   | `KafkaConstants.TOPIC` | `kafka.TOPIC` | `CamelKafkaTopic` |
   | `KafkaConstants.OVERRIDE_TOPIC` | `kafka.OVERRIDE_TOPIC` | `CamelKafkaOverrideTopic` |
   | `KafkaConstants.OFFSET` | `kafka.OFFSET` | `CamelKafkaOffset` |
   | `KafkaConstants.HEADERS` | `kafka.HEADERS` | `CamelKafkaHeaders` |
   | `KafkaConstants.LAST_RECORD_BEFORE_COMMIT` | `kafka.LAST_RECORD_BEFORE_COMMIT` | `CamelKafkaLastRecordBeforeCommit` |
   | `KafkaConstants.LAST_POLL_RECORD` | `kafka.LAST_POLL_RECORD` | `CamelKafkaLastPollRecord` |
   | `KafkaConstants.TIMESTAMP` | `kafka.TIMESTAMP` | `CamelKafkaTimestamp` |
   | `KafkaConstants.OVERRIDE_TIMESTAMP` | `kafka.OVERRIDE_TIMESTAMP` | `CamelKafkaOverrideTimestamp` |
   | `KafkaConstants.KAFKA_RECORD_META` | `kafka.RECORD_META` | `CamelKafkaRecordMeta` |
   
   `KafkaConstants.MANUAL_COMMIT` was already Camel-prefixed (`CamelKafkaManualCommit`) and is unchanged. The non-header constants in the class (`KAFKA_DEFAULT_ENCODER`, `KAFKA_STRING_ENCODER`, `KAFKA_DEFAULT_SERIALIZER`, `KAFKA_DEFAULT_DESERIALIZER`, `PARTITIONER_RANGE_ASSIGNOR`, `KAFKA_SUBSCRIBE_ADAPTER`) are not Exchange headers and are unchanged.
   
   ### Backwards-compatibility
   
   - **Java field names are unchanged.** Routes that reference the constants symbolically (`setHeader(KafkaConstants.OVERRIDE_TOPIC, ...)`) continue to work without changes.
   - **Routes hard-coding the literal `kafka.*` strings** (e.g. `setHeader("kafka.OVERRIDE_TOPIC", ...)` or Simple expressions like `${headers[kafka.TOPIC]}`) **must be updated** to the new `CamelKafka*` values.
   - The 4.21 upgrade guide entry is marked as a "potential breaking change" with the full rename table and a worked example, given the wider installed base of camel-kafka than the niche sibling components in the sweep.
   - The Endpoint DSL header accessor method names on `KafkaEndpointBuilderFactory$KafkaHeaderNameBuilder` (e.g. `kafkaOverrideTopic()`, `kafkaTopic()`, `kafkaPartitionKey()`) **keep their method names**; only the returned string value reflects the new convention.
   
   ### Cross-module updates
   
   - `KafkaHeaderDeserializer` and the bundled Kafka Connect-style transformers (`RegexRouter`, `TimestampRouter`, `MessageTimestampRouter`, `ValueToKey`) now use the symbolic `KafkaConstants` references instead of literal `"kafka.*"` strings.
   - The local copies of the constants in `org.apache.camel.tracing.decorators.KafkaSpanDecorator` (deprecated since 4.19.0) and `org.apache.camel.telemetry.decorators.KafkaSpanDecorator` are kept in sync with the new values so Kafka span tagging continues to work for routes that have migrated to the new header names.
   - The camel-opentelemetry2 mock Kafka producer and `SpanKindTest` are updated to use the new header names.
   - `KafkaProducerTest`, `RegexRouterTest`, and `KafkaConsumerFullIT` are updated to use the `KafkaConstants` symbolic references.
   - The consumer examples in `kafka-component.adoc` that use Simple expressions to read these headers (`${headers[CamelKafkaTopic]}` etc.) are updated.
   
   ### Regenerated artifacts
   
   - `components/camel-kafka` component catalog (`kafka.json`)
   - Project-wide `catalog/camel-catalog` mirror and `important-headers.json`
   - `core/camel-util/ImportantHeaderUtils.java`
   - `dsl/camel-endpointdsl/.../KafkaEndpointBuilderFactory.java`
   
   Plus the new `camel-kafka - potential breaking change` entry in `docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc`.
   
   ### Sibling sub-tasks under CAMEL-23577
   
   This sub-task follows the pattern established in CAMEL-23576 (camel-jira), CAMEL-23574 (camel-dns), CAMEL-23575 (camel-mongodb-gridfs), CAMEL-23578 (camel-web3j), CAMEL-23579 (camel-pdf), CAMEL-23580 (camel-openstack), CAMEL-23581 (camel-elasticsearch / camel-opensearch), CAMEL-23582 (camel-github2), CAMEL-23585 (camel-arangodb), CAMEL-23587 (camel-jt400), CAMEL-23588 (camel-undertow), CAMEL-23590 (camel-milo), CAMEL-23592 (camel-shiro), CAMEL-23597 (camel-solr), and CAMEL-23629 (camel-irc).
   
   ## Test plan
   
   - [x] `mvn install` in `components/camel-kafka` — passes (unit tests + catalog regen)
   - [x] `mvn test` in `components/camel-tracing` — passes
   - [x] `mvn test` in `components/camel-telemetry` — passes
   - [x] `mvn test` in `components/camel-opentelemetry2` — passes (after `mvn install` of upstream changes — SpanKindTest correctly exercises the renamed headers through the camel-telemetry KafkaSpanDecorator)
   - [x] Full reactor `mvn clean install -DskipTests` from root — passes, all downstream catalog / DSL / important-headers generators regenerate cleanly
   
   _Reported by Claude Code on behalf of Andrea Cosentino_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23602:
URL: https://github.com/apache/camel/pull/23602#issuecomment-4565153529

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention [camel]

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd merged PR #23602:
URL: https://github.com/apache/camel/pull/23602


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23602:
URL: https://github.com/apache/camel/pull/23602#issuecomment-4565474603

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-kafka`
   - `components/camel-opentelemetry2`
   - `components/camel-telemetry`
   - `components/camel-tracing`
   - `core/camel-util`
   - `docs`
   - `dsl/camel-endpointdsl`
   
   > :information_source: Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the `test-dependents` label to force testing all dependents.
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `components/camel-kafka`: 2 test(s) disabled on GitHub Actions
   
   <details><summary>Build reactor — dependencies compiled but only changed modules were tested (8 modules)</summary>
   
   - Camel :: Catalog :: Camel Catalog
   - Camel :: Common Telemetry
   - Camel :: Common Tracing (deprecated)
   - Camel :: Docs
   - Camel :: Endpoint DSL
   - Camel :: Kafka
   - Camel :: Opentelemetry 2
   - Camel :: Util
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/26581428543)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org