Skip to content

[backport camel-4.14.x] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention#23632

Merged
oscerd merged 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23584-4.14.x
May 29, 2026
Merged

[backport camel-4.14.x] CAMEL-23584: camel-kafka - align Exchange header constant names with Camel naming convention#23632
oscerd merged 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-23584-4.14.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 29, 2026

Backport of #23602 (CAMEL-23584) to the camel-4.14.x maintenance branch.

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 umbrella header-naming-convention sweep.

Constant Previous value New value
PARTITION_KEY kafka.PARTITION_KEY CamelKafkaPartitionKey
PARTITION kafka.PARTITION CamelKafkaPartition
KEY kafka.KEY CamelKafkaKey
TOPIC kafka.TOPIC CamelKafkaTopic
OVERRIDE_TOPIC kafka.OVERRIDE_TOPIC CamelKafkaOverrideTopic
OFFSET kafka.OFFSET CamelKafkaOffset
HEADERS kafka.HEADERS CamelKafkaHeaders
LAST_RECORD_BEFORE_COMMIT kafka.LAST_RECORD_BEFORE_COMMIT CamelKafkaLastRecordBeforeCommit
LAST_POLL_RECORD kafka.LAST_POLL_RECORD CamelKafkaLastPollRecord
TIMESTAMP kafka.TIMESTAMP CamelKafkaTimestamp
OVERRIDE_TIMESTAMP kafka.OVERRIDE_TIMESTAMP CamelKafkaOverrideTimestamp
KAFKA_RECORD_META kafka.RECORD_META CamelKafkaRecordMeta

Backwards-compatibility

  • Java field names are unchanged → routes using the symbolic constants are unaffected.
  • Routes hard-coding the literal kafka.* header strings must move to the new CamelKafka* values.
  • The Endpoint DSL header accessor method names (kafkaOverrideTopic(), etc.) are unchanged; only the returned string value reflects the new convention.

Notes for this backport

  • KafkaConstants on camel-4.14.x differs from main (no important=true metadata flags, different description wording). Only the string values were changed here — the 4.14.x structure is otherwise preserved.
  • The version-specific upgrade-guide entry is added on the main branch (per the backport upgrade-guide policy), not on this maintenance branch.
  • Keeps the bundled transform classes, KafkaHeaderDeserializer, and the camel-tracing / camel-telemetry KafkaSpanDecorator copies in sync. Regenerates the catalog and endpoint DSL artifacts.
  • The camel-opentelemetry2 SpanKindTest / mock producer, the core ImportantHeaderUtils, and the important-headers.json catalog do not exist on this branch and are intentionally not part of this backport.

Test plan

  • camel-kafka unit tests (KafkaProducerTest, RegexRouterTest, transform tests, KafkaHeaderDeserializerTest) — pass
  • Full reactor mvn clean install -DskipTests from root — passes, all downstream generators regenerate cleanly

Reported by Claude Code on behalf of Andrea Cosentino

…der constant names with Camel naming convention

Backport of CAMEL-23584 to the camel-4.14.x maintenance branch.

Renames the Exchange header string values in KafkaConstants from the
non-Camel-prefixed "kafka.*" namespace to the project-wide "CamelKafka*"
PascalCase convention. The Java field names are unchanged, so routes that
reference the constants symbolically continue to work without changes;
routes that set or read the headers using the literal "kafka.*" string
values must be updated to use the new "CamelKafka*" values.

Keeps the bundled transform classes (RegexRouter, TimestampRouter,
MessageTimestampRouter, ValueToKey), the KafkaHeaderDeserializer, and the
camel-tracing / camel-telemetry KafkaSpanDecorator copies in sync, and
regenerates the catalog and endpoint DSL artifacts. The camel-opentelemetry2
SpanKindTest / mock producer, the core ImportantHeaderUtils, and the
important-headers.json catalog do not exist on this branch and are not part
of this backport.

The version-specific upgrade-guide entry is added on the main branch (per
the backport upgrade-guide policy), not on this maintenance branch.

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd requested review from davsclaus and gnodet May 29, 2026 09:17
@oscerd oscerd merged commit 93cd4c4 into apache:camel-4.14.x May 29, 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.

2 participants