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 9a4a52f5eed12..afc0ddc7bb70a 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: the phone number ID comes from the endpoint URI, as the phoneNumberId path parameter", "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": 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 recipient comes from the to field of the BaseMessage the body is converted to", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID" } }, "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 route, unless webhookVerification is false" }, 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 9a4a52f5eed12..afc0ddc7bb70a 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: the phone number ID comes from the endpoint URI, as the phoneNumberId path parameter", "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": 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 recipient comes from the to field of the BaseMessage the body is converted to", "constantName": "org.apache.camel.component.whatsapp.WhatsAppConstants#WHATSAPP_RECIPIENT_PHONE_NUMBER_ID" } }, "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 route, unless webhookVerification is false" }, 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 387c997ea6355..0edf8ad3415d0 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 @@ 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 bb1c272dca266..1ece53de0db73 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 @@ -9343,6 +9343,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 873f32335e91d..c1668137c434d 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 static class WhatsAppHeaderNameBuilder { /** * 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 static class WhatsAppHeaderNameBuilder { * * @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 String whatsAppPhoneNumberId() { * @return the name of the header {@code * WhatsAppRecipientPhoneNumberId}. */ + @Deprecated public String whatsAppRecipientPhoneNumberId() { return "CamelWhatsAppRecipientPhoneNumberId"; }