This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new c092f744f648 camel-whatsapp: deprecate both documented headers, which 
nothing reads (#29958)
c092f744f648 is described below

commit c092f744f648bd42fc91cc6c00681cf9c37d2ce4
Author: dhairya05 <[email protected]>
AuthorDate: Tue Nov 17 03:28:07 2026 +0530

    camel-whatsapp: deprecate both documented headers, which nothing reads 
(#29958)
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 .../apache/camel/catalog/components/whatsapp.json  |  4 ++--
 .../apache/camel/component/whatsapp/whatsapp.json  |  4 ++--
 .../component/whatsapp/WhatsAppConstants.java      | 10 +++++++--
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    | 26 ++++++++++++++++++++++
 .../dsl/WhatsAppEndpointBuilderFactory.java        |  8 ++++++-
 5 files changed, 45 insertions(+), 7 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json
index 9a4a52f5eed1..afc0ddc7bb70 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/whatsapp.json
@@ -35,8 +35,8 @@
     "authorizationToken": { "index": 8, "kind": "property", "displayName": 
"Authorization Token", "group": "security", "label": "security", "required": 
true, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": true, "security": "secret", "description": 
"Authorization Token taken from WhatsApp Meta for Developers Dashboard" }
   },
   "headers": {
-    "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": false, "autowired": false, "secret": false, 
"description": "Phone Number ID taken from WhatsApp Meta for Developers 
Dashboard", "constantName": 
"org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_PHONE_NUMBER_ID"
 },
-    "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": false, "autowired": false, "secret": false, 
"description": "Recipient phone number associated with Phone Number ID", 
"constantName": 
"org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID"
 }
+    "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": true, "deprecationNote": "Never read by the 
component: the phone number ID comes from the endpoint URI, as the 
phoneNumberId path parameter", "autowired": false, "secret": false, 
"description": "Phone Number ID taken from WhatsApp Meta for Developers 
Dashboard. Deprecation note: Never read by the component: t [...]
+    "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": true, "deprecationNote": "Never read by the 
component: the recipient comes from the to field of the BaseMessage the body is 
converted to", "autowired": false, "secret": false, "description": "Recipient 
phone number associated with Phone Number ID. Deprecation note: Never read by 
the component: the re [...]
   },
   "bodyTypes": {
     "consumerOut": { "carriers": [ "text", "null" ], "description": "In 
webhook mode (webhook:whatsapp:...), the event that WhatsApp posts, as JSON 
text. The verification request of WhatsApp (a GET) also reaches the route, with 
the hub.challenge as the body when hub.mode is subscribe and hub.verify_token 
matches webhookVerifyToken, else with no body (403, or 400 when the parameters 
are missing). An event without a valid X-Hub-Signature-256 is answered with 403 
and does not reach the rout [...]
diff --git 
a/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json
 
b/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json
index 9a4a52f5eed1..afc0ddc7bb70 100644
--- 
a/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json
+++ 
b/components/camel-whatsapp/src/generated/resources/META-INF/org/apache/camel/component/whatsapp/whatsapp.json
@@ -35,8 +35,8 @@
     "authorizationToken": { "index": 8, "kind": "property", "displayName": 
"Authorization Token", "group": "security", "label": "security", "required": 
true, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": true, "security": "secret", "description": 
"Authorization Token taken from WhatsApp Meta for Developers Dashboard" }
   },
   "headers": {
-    "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": false, "autowired": false, "secret": false, 
"description": "Phone Number ID taken from WhatsApp Meta for Developers 
Dashboard", "constantName": 
"org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_PHONE_NUMBER_ID"
 },
-    "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": false, "autowired": false, "secret": false, 
"description": "Recipient phone number associated with Phone Number ID", 
"constantName": 
"org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID"
 }
+    "CamelWhatsAppPhoneNumberId": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": true, "deprecationNote": "Never read by the 
component: the phone number ID comes from the endpoint URI, as the 
phoneNumberId path parameter", "autowired": false, "secret": false, 
"description": "Phone Number ID taken from WhatsApp Meta for Developers 
Dashboard. Deprecation note: Never read by the component: t [...]
+    "CamelWhatsAppRecipientPhoneNumberId": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Object", "deprecated": true, "deprecationNote": "Never read by the 
component: the recipient comes from the to field of the BaseMessage the body is 
converted to", "autowired": false, "secret": false, "description": "Recipient 
phone number associated with Phone Number ID. Deprecation note: Never read by 
the component: the re [...]
   },
   "bodyTypes": {
     "consumerOut": { "carriers": [ "text", "null" ], "description": "In 
webhook mode (webhook:whatsapp:...), the event that WhatsApp posts, as JSON 
text. The verification request of WhatsApp (a GET) also reaches the route, with 
the hub.challenge as the body when hub.mode is subscribe and hub.verify_token 
matches webhookVerifyToken, else with no body (403, or 400 when the parameters 
are missing). An event without a valid X-Hub-Signature-256 is answered with 403 
and does not reach the rout [...]
diff --git 
a/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppConstants.java
 
b/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppConstants.java
index 387c997ea635..0edf8ad3415d 100644
--- 
a/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppConstants.java
+++ 
b/components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/WhatsAppConstants.java
@@ -21,10 +21,16 @@ import org.apache.camel.spi.Metadata;
 public final class WhatsAppConstants {
 
     @Metadata(label = "producer", description = "Phone Number ID taken from 
WhatsApp Meta for Developers Dashboard",
-              javaType = "Object")
+              javaType = "Object",
+              deprecationNote = "Never read by the component: the phone number 
ID comes from the endpoint URI, as the"
+                                + " phoneNumberId path parameter")
+    @Deprecated
     public static final String WHATSAPP_PHONE_NUMBER_ID = 
"CamelWhatsAppPhoneNumberId";
 
-    @Metadata(label = "producer", description = "Recipient phone number 
associated with Phone Number ID", javaType = "Object")
+    @Metadata(label = "producer", description = "Recipient phone number 
associated with Phone Number ID", javaType = "Object",
+              deprecationNote = "Never read by the component: the recipient 
comes from the to field of the BaseMessage the body"
+                                + " is converted to")
+    @Deprecated
     public static final String WHATSAPP_RECIPIENT_PHONE_NUMBER_ID = 
"CamelWhatsAppRecipientPhoneNumberId";
 
     private WhatsAppConstants() {
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 47dced636a7d..f4f9b9c3dc2d 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -9533,6 +9533,32 @@ the permission with `CamelKeycloakPermissionId`
 
 Each is now deprecated, with a `deprecationNote` carrying the same information.
 
+=== camel-whatsapp - both documented headers are deprecated
+
+`CamelWhatsAppPhoneNumberId` and `CamelWhatsAppRecipientPhoneNumberId` were 
the only two headers the component
+documented, and it reads neither. A route that sets them gets no error and no 
effect.
+
+The phone number ID is the path parameter of the endpoint, so set it in the 
URI:
+
+[source,java]
+----
+from("direct:start")
+    .to("whatsapp:1234567890?authorizationToken=token");
+----
+
+The recipient is the `to` field of the `BaseMessage` the producer converts the 
body to, since `WhatsAppProducer` sends
+`exchange.getIn().getBody(BaseMessage.class)` as it is:
+
+[source,java]
+----
+TextMessageRequest request = new TextMessageRequest();
+request.setTo("15550001111");
+request.setText(new TextMessage());
+request.getText().setBody("Hello");
+----
+
+Both headers are now deprecated, each with a `deprecationNote` that names the 
replacement.
+
 === camel-docker - the loggingFilter and followRedirectFilter options are 
deprecated
 
 Neither option has had any effect since Camel 2.18, when the docker-java 3.x 
upgrade removed the
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WhatsAppEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WhatsAppEndpointBuilderFactory.java
index 873f32335e91..c1668137c434 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WhatsAppEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WhatsAppEndpointBuilderFactory.java
@@ -908,6 +908,8 @@ public interface WhatsAppEndpointBuilderFactory {
 
         /**
          * Phone Number ID taken from WhatsApp Meta for Developers Dashboard.
+         * Deprecation note: Never read by the component: the phone number ID
+         * comes from the endpoint URI, as the phoneNumberId path parameter.
          * 
          * The option is a: {@code Object} type.
          * 
@@ -915,11 +917,14 @@ public interface WhatsAppEndpointBuilderFactory {
          * 
          * @return the name of the header {@code WhatsAppPhoneNumberId}.
          */
+        @Deprecated
         public String whatsAppPhoneNumberId() {
             return "CamelWhatsAppPhoneNumberId";
         }
         /**
-         * Recipient phone number associated with Phone Number ID.
+         * Recipient phone number associated with Phone Number ID. Deprecation
+         * note: Never read by the component: the recipient comes from the to
+         * field of the BaseMessage the body is converted to.
          * 
          * The option is a: {@code Object} type.
          * 
@@ -928,6 +933,7 @@ public interface WhatsAppEndpointBuilderFactory {
          * @return the name of the header {@code
          * WhatsAppRecipientPhoneNumberId}.
          */
+        @Deprecated
         public String whatsAppRecipientPhoneNumberId() {
             return "CamelWhatsAppRecipientPhoneNumberId";
         }

Reply via email to