Skip to content

[backport camel-4.14.x] CAMEL-23574: camel-dns - align Exchange header constant names with Camel naming convention#23482

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

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

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 22, 2026

Backport of #23411 to camel-4.14.x

Cherry-pick of #23411 onto camel-4.14.x (fixVersion 4.14.8).

Renames the Exchange header string values in DnsConstants from the legacy
dotted-lowercase names to the project-wide Camel<Component><Field> convention:

Constant Previous value New value
DnsConstants.DNS_CLASS dns.class CamelDnsClass
DnsConstants.DNS_NAME dns.name CamelDnsName
DnsConstants.DNS_DOMAIN dns.domain CamelDnsDomain
DnsConstants.DNS_SERVER dns.server CamelDnsServer
DnsConstants.DNS_TYPE dns.type CamelDnsType
DnsConstants.TERM term CamelDnsTerm

The Java field names are unchanged, so routes that reference the constants
symbolically keep working; routes that set the headers by literal string value
must be updated.

Notes for this backport

  • Code, in-module tests, component doc, and regenerated artifacts (component
    metadata, catalog, endpoint DSL factory) only.
  • The conflicted IP/Lookup tests were resolved by keeping the existing 4.14.x
    test idioms (try/catch + JUnit5) and applying only the literal-to-constant
    header rename, then verified with mvn clean install in components/camel-dns
    (23 tests, 0 failures).
  • The version-specific upgrade-guide entry (camel-4x-upgrade-guide-4_14.adoc)
    is added on main via a separate doc-sync PR, per the backport
    upgrade-guide policy (canonical guides live on main).

Original PR: #23411
Original author: @oscerd


Claude Code on behalf of Andrea Cosentino

…r constant names with Camel naming convention

Backport of apache#23411.

Rename the Exchange header string values in DnsConstants from dotted lowercase
(dns.class / dns.name / dns.domain / dns.server / dns.type / term) to the
project-wide Camel<Component><Field> convention:

  DNS_CLASS  -> CamelDnsClass
  DNS_NAME   -> CamelDnsName
  DNS_DOMAIN -> CamelDnsDomain
  DNS_SERVER -> CamelDnsServer
  DNS_TYPE   -> CamelDnsType
  TERM       -> CamelDnsTerm

The Java field names 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.

Updates the in-module tests to go through DnsConstants (preserving the existing
4.14.x test idioms), refreshes the DnsComponent / DnsWikipediaProducer Javadoc
and the component documentation references, and regenerates the component
metadata, catalog, and endpoint DSL factory.

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

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
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.

Clean backport of #23411 to camel-4.14.x. Verified the following:

  • Header renames: All six constants in DnsConstants correctly renamed from dotted-lowercase (dns.class, dns.name, etc.) to Camel<Component><Field> convention (CamelDnsClass, CamelDnsName, etc.) -- identical to the original PR and the 4.18.x backport (#23459).
  • File coverage: Same 16 files as the 4.18.x backport -- source, generated artifacts (catalog JSON, endpoint DSL factory), docs, and tests. No files missing, no extra files.
  • Tests: All 9 test files updated from literal header strings to DnsConstants.* references. The existing 4.14.x test idioms (try/catch + fail() + JUnit 5) are correctly preserved -- only the header key references changed.
  • Docs: dns-component.adoc correctly updated. The dns.query to CamelDnsName fix in the Dig section is a pre-existing doc bug fix (there was never a dns.query header -- DnsDigProducer reads DNS_NAME), matching the original PR.
  • Upgrade guide: Correctly omitted from this branch per backport policy. The PR description states a separate doc-sync PR will add the camel-4x-upgrade-guide-4_14.adoc entry on main.
  • Generated artifacts: dns.json (both catalog and component-local) and DnsEndpointBuilderFactory.java are consistent with the constant value changes.

LGTM.

Claude Code on behalf of Guillaume Nodet

@oscerd oscerd merged commit a6d8a44 into apache:camel-4.14.x May 23, 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