Repository navigation
camel-whatsapp: deprecate both documented headers, which nothing reads - #29958
Dhairya-007 wants to merge 6 commits into
Conversation
WhatsAppConstants publishes exactly two headers and the component reads
neither; WhatsAppProducer takes nothing but the body:
BaseMessage message = exchange.getIn().getBody(BaseMessage.class);
ObjectHelper.notNull(message, "message");
service.sendMessage(exchange, callback, message);
CamelWhatsAppPhoneNumberId duplicates the endpoint's phoneNumberId path
parameter, which WhatsAppComponent sets from the remaining URI and the
endpoint passes to the service, and CamelWhatsAppRecipientPhoneNumberId
duplicates the to field of the BaseMessage the body is converted to.
Neither name appears anywhere else in the component, including tests -
the matching test names are the WHATSAPP_PHONE_NUMBER_ID and
WHATSAPP_RECIPIENT_PHONE_NUMBER environment variables of the
integration test, which are unrelated.
So the whole header table of the component documents two headers that do
nothing. Deprecate both, with a note naming what carries the value.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
davsclaus
left a comment
There was a problem hiding this comment.
Nice catch. On main, WhatsAppProducer only logs the headers, and neither CamelWhatsAppPhoneNumberId nor CamelWhatsAppRecipientPhoneNumberId is read anywhere, now or in 3.20.0/4.0.0. The WHATSAPP_* hits in the tests are env vars, as you say. The notes are accurate: WhatsAppComponent sets phoneNumberId from the URI, and BaseMessage has to.
WhatsAppEndpointBuilderFactory(dsl/camel-endpointdsl/src/generated/...,whatsAppPhoneNumberId()/whatsAppRecipientPhoneNumberId()) needs regenerating, as in #29709. Otherwise CI will likely flag uncommitted changes.- Please add an entry to
camel-4x-upgrade-guide-4_24.adocfor the two deprecated headers.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
✅ Generated files are up to dateAn earlier CI run reported uncommitted generated changes; the latest run no longer does. |
davsclaus
left a comment
There was a problem hiding this comment.
Thanks, the Regen commit added @Deprecated and the notes to whatsAppPhoneNumberId() and whatsAppRecipientPhoneNumberId() in WhatsAppEndpointBuilderFactory, so the generated-files point is done.
- The upgrade-guide entry is still missing: please add one to
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adocforCamelWhatsAppPhoneNumberIdandCamelWhatsAppRecipientPhoneNumberId, telling users to setphoneNumberIdon the endpoint URI and the recipient astoon the message body instead.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
🧪 CI tested the following changed modules:
🔁 1 test passed only after a retry on JDK 21 (1 retried attempt) Recovered flaky tests on JDK 21 (1)
🔬 Scalpel shadow comparison — Scalpel: 9 of 726 tested, 24 compile-only — current: 9 all testedMaveniverse Scalpel detected 9 affected modules (current approach: 9). Skip-tests mode would test 9 modules (4 direct + 8 downstream), skip tests for 24 (generated code, meta-modules) Modules Scalpel would test (9)
Modules with tests skipped (24)
All tested modules (36 modules, 4m 39s total)Total reactor time: 4m 39s
Top 20 slowest modules:
|
…ed headers Says where each value belongs instead: the phone number ID in the endpoint path, the recipient in the to field of the BaseMessage the producer converts the body to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Added, thanks — It says the phone number ID belongs in the endpoint path ( |
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. Both headers correctly deprecated with accurate deprecationNote values, generated files (catalog JSON, EndpointDSL factory) regenerated, and the 4.24 upgrade-guide entry added. The two items raised by @davsclaus are fully addressed.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
# Conflicts: # docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
davsclaus
left a comment
There was a problem hiding this comment.
Thanks @Dhairya-007, the upgrade-guide entry is in and does what I asked: users put the phone number ID in the endpoint URI and the recipient in the to field of the message body. The examples match the code: phoneNumberId is the @UriPath of WhatsAppConfiguration, WhatsAppProducer.java:53 sends getBody(BaseMessage.class) as it is, and TextMessageRequest / TextMessage have the setters the snippet uses.
LGTM.
Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
Thanks @Dhairya-007, this is approved and ready to merge, but it now conflicts with main. #29954 (camel-docker deprecations) was merged and also adds a section at the end of Claude Code on behalf of davsclaus |
|
Thanks, this is approved and green, but it now conflicts with main in Claude Code on behalf of davsclaus |
|
@Dhairya-007 thanks, this one is approved, but it now conflicts with Claude Code on behalf of davsclaus |
gnodet-bot
left a comment
There was a problem hiding this comment.
Previous findings remain addressed — no diff changes since prior LGTM review (HEAD SHA f72bb157).
Both headers (CamelWhatsAppPhoneNumberId, CamelWhatsAppRecipientPhoneNumberId) verified unused: WhatsAppProducer.process() converts the body to BaseMessage directly without reading any headers. @Deprecated annotations, deprecationNote values, catalog JSON updates, EndpointDSL factory methods, and upgrade guide entry are all correct and consistent.
Needs a rebase on main — davsclaus has flagged the merge conflict in camel-4x-upgrade-guide-4_24.adoc three times. Once rebased, this is ready to merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
oscerd
left a comment
There was a problem hiding this comment.
Checked the two headers against the sources, and the deprecation is justified.
WhatsAppConstants publishes exactly WHATSAPP_PHONE_NUMBER_ID and WHATSAPP_RECIPIENT_PHONE_NUMBER_ID, and neither is read in main: WhatsAppProducer.process takes the body as a BaseMessage and the only header call it makes is getHeaders() for a debug log, not a lookup of either constant. The webhook processor does read headers, but they are the HTTP ones and HUB_SIGNATURE_HEADER, which is a separate constant, not one of these two, so it does not contradict the claim.
Both are deprecated with a deprecationNote that names where the value actually comes from, and there is an upgrade-guide entry, which is the correct treatment for a documented public header that does nothing: keep it a cycle, tell users it is inert and point at the real carrier. The regen is included and CI is green. Reasonable.
Claude Code on behalf of oscerd
Resolves the conflict with main in the 4.24 upgrade guide (both entries kept). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — the rebase conflict blocker is now resolved.
The merge commit from @davsclaus (SHA 995a6f77) resolved the upgrade guide conflict in camel-4x-upgrade-guide-4_24.adoc, keeping both the camel-keycloak section (from the concurrent merge) and the camel-whatsapp section from this PR. Both are present and correct in the diff.
The original content is unchanged and still accurate:
- ✅ Both headers correctly deprecated with accurate
deprecationNotevalues - ✅ Generated files (catalog JSON, EndpointDSL factory) already regenerated
- ✅ Upgrade guide entry in place, examples match the actual
WhatsAppProducerbehavior - ✅ Rebase conflict resolved — ready to merge
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Problem
WhatsAppConstantspublishes exactly two headers, and the component reads neither - so the whole header table ofcamel-whatsappdocuments headers that do nothing.WhatsAppProducer.processtakes nothing but the body:The headers are logged and then ignored. What actually carries each value is an option or a body field that already exists:
CamelWhatsAppPhoneNumberIdduplicates thephoneNumberIdpath parameter.WhatsAppComponentsets it from the remaining URI (configuration.setPhoneNumberId(remaining)) andWhatsAppEndpointpassesconfiguration.getPhoneNumberId()to the service.CamelWhatsAppRecipientPhoneNumberIdduplicates thetofield of theBaseMessagethe body is converted to.Neither constant appears anywhere else in the component, tests included. (A grep turns up
WHATSAPP_PHONE_NUMBER_IDandWHATSAPP_RECIPIENT_PHONE_NUMBERinWhatsAppApiConfigandWhatsAppServiceIT, but those are environment variable names for the integration test, not these headers.)Fix
Deprecate both constants, each with a
deprecationNotenaming what carries the value instead, so the catalog stops advertising them. The constants stay, so nothing stops compiling.The regenerated
whatsapp.jsonfiles are included.