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

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


The following commit(s) were added to refs/heads/camel-4.18.x by this push:
     new 2e6854d23d6c [backport camel-4.18.x] CAMEL-24535: 
camel-tensorflow-serving - deprecate the Target and Credentials headers (#26317)
2e6854d23d6c is described below

commit 2e6854d23d6cdb15d8a1a3cb2bae63d325c772b7
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Sep 11 21:17:47 2026 +0200

    [backport camel-4.18.x] CAMEL-24535: camel-tensorflow-serving - deprecate 
the Target and Credentials headers (#26317)
    
    Backport of #26194 to camel-4.18.x.
    
    Co-authored-by: Claude Opus 5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../camel/catalog/components/tensorflow-serving.json |  4 ++--
 .../tensorflow/serving/tensorflow-serving.json       |  4 ++--
 .../serving/TensorFlowServingConstants.java          | 20 ++++++++++++++++++--
 .../ROOT/pages/camel-4x-upgrade-guide-4_18.adoc      | 16 ++++++++++++++++
 .../dsl/TensorFlowServingEndpointBuilderFactory.java |  9 +++++++--
 5 files changed, 45 insertions(+), 8 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/tensorflow-serving.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/tensorflow-serving.json
index c4db1df5dead..154db23c3ee1 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/tensorflow-serving.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/tensorflow-serving.json
@@ -35,8 +35,8 @@
     "credentials": { "index": 8, "kind": "property", "displayName": 
"Credentials", "group": "security", "label": "security", "required": false, 
"type": "object", "javaType": "io.grpc.ChannelCredentials", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConfiguration", 
"configurationField": "configuration", "description": "The credentials of the 
client." }
   },
   "headers": {
-    "CamelTensorFlowServingTarget": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The target of the client. See: 
https:\/\/grpc.github.io\/grpc-java\/javadoc\/io\/grpc\/Grpc.html#newChannelBuilder%28java.lang.String,io.grpc.ChannelCredentials%29",
 "constantName": "org.apache.camel.component.tensorflow.serving.Tens [...]
-    "CamelTensorFlowServingCredentials": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "io.grpc.ChannelCredentials", "deprecated": false, 
"deprecationNote": "", "autowired": false, "secret": false, "description": "The 
credentials of the client.", "constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#CREDENTIALS"
 },
+    "CamelTensorFlowServingTarget": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": true, "deprecationNote": "Never read by the 
component. The gRPC channel is built once when the endpoint is initialised, so 
it cannot be redirected per exchange. Use the target endpoint option.", 
"autowired": false, "secret": false, "description": "The target of the client. 
See: https:\/\/grpc.github.io\/grpc-java\/ [...]
+    "CamelTensorFlowServingCredentials": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "io.grpc.ChannelCredentials", "deprecated": true, 
"deprecationNote": "Never read by the component. The gRPC channel is built once 
when the endpoint is initialised, so it cannot be re-authenticated per 
exchange. Use the credentials endpoint option.", "autowired": false, "secret": 
false, "description": "The credentials of the client. D [...]
     "CamelTensorFlowServingModelName": { "index": 2, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Required servable name.", 
"constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_NAME"
 },
     "CamelTensorFlowServingModelVersion": { "index": 3, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Optional choice of which version of the 
model to use. Use this specific version number.", "constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_VERSION"
 },
     "CamelTensorFlowServingModelVersionLabel": { "index": 4, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Optional choice of which version of the 
model to use. Use the version associated with the given label.", 
"constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_VERSION_LABEL"
 },
diff --git 
a/components/camel-ai/camel-tensorflow-serving/src/generated/resources/META-INF/org/apache/camel/component/tensorflow/serving/tensorflow-serving.json
 
b/components/camel-ai/camel-tensorflow-serving/src/generated/resources/META-INF/org/apache/camel/component/tensorflow/serving/tensorflow-serving.json
index c4db1df5dead..154db23c3ee1 100644
--- 
a/components/camel-ai/camel-tensorflow-serving/src/generated/resources/META-INF/org/apache/camel/component/tensorflow/serving/tensorflow-serving.json
+++ 
b/components/camel-ai/camel-tensorflow-serving/src/generated/resources/META-INF/org/apache/camel/component/tensorflow/serving/tensorflow-serving.json
@@ -35,8 +35,8 @@
     "credentials": { "index": 8, "kind": "property", "displayName": 
"Credentials", "group": "security", "label": "security", "required": false, 
"type": "object", "javaType": "io.grpc.ChannelCredentials", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConfiguration", 
"configurationField": "configuration", "description": "The credentials of the 
client." }
   },
   "headers": {
-    "CamelTensorFlowServingTarget": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The target of the client. See: 
https:\/\/grpc.github.io\/grpc-java\/javadoc\/io\/grpc\/Grpc.html#newChannelBuilder%28java.lang.String,io.grpc.ChannelCredentials%29",
 "constantName": "org.apache.camel.component.tensorflow.serving.Tens [...]
-    "CamelTensorFlowServingCredentials": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "io.grpc.ChannelCredentials", "deprecated": false, 
"deprecationNote": "", "autowired": false, "secret": false, "description": "The 
credentials of the client.", "constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#CREDENTIALS"
 },
+    "CamelTensorFlowServingTarget": { "index": 0, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": true, "deprecationNote": "Never read by the 
component. The gRPC channel is built once when the endpoint is initialised, so 
it cannot be redirected per exchange. Use the target endpoint option.", 
"autowired": false, "secret": false, "description": "The target of the client. 
See: https:\/\/grpc.github.io\/grpc-java\/ [...]
+    "CamelTensorFlowServingCredentials": { "index": 1, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "io.grpc.ChannelCredentials", "deprecated": true, 
"deprecationNote": "Never read by the component. The gRPC channel is built once 
when the endpoint is initialised, so it cannot be re-authenticated per 
exchange. Use the credentials endpoint option.", "autowired": false, "secret": 
false, "description": "The credentials of the client. D [...]
     "CamelTensorFlowServingModelName": { "index": 2, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Required servable name.", 
"constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_NAME"
 },
     "CamelTensorFlowServingModelVersion": { "index": 3, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Optional choice of which version of the 
model to use. Use this specific version number.", "constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_VERSION"
 },
     "CamelTensorFlowServingModelVersionLabel": { "index": 4, "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "Optional choice of which version of the 
model to use. Use the version associated with the given label.", 
"constantName": 
"org.apache.camel.component.tensorflow.serving.TensorFlowServingConstants#MODEL_VERSION_LABEL"
 },
diff --git 
a/components/camel-ai/camel-tensorflow-serving/src/main/java/org/apache/camel/component/tensorflow/serving/TensorFlowServingConstants.java
 
b/components/camel-ai/camel-tensorflow-serving/src/main/java/org/apache/camel/component/tensorflow/serving/TensorFlowServingConstants.java
index d66d34975f70..a45447ca5e5c 100644
--- 
a/components/camel-ai/camel-tensorflow-serving/src/main/java/org/apache/camel/component/tensorflow/serving/TensorFlowServingConstants.java
+++ 
b/components/camel-ai/camel-tensorflow-serving/src/main/java/org/apache/camel/component/tensorflow/serving/TensorFlowServingConstants.java
@@ -23,11 +23,27 @@ import org.apache.camel.spi.Metadata;
  */
 public interface TensorFlowServingConstants {
 
+    /**
+     * @deprecated Never read by the component. The gRPC channel is built once 
when the endpoint is initialised, so it
+     *             cannot be redirected per exchange. Use the {@code target} 
endpoint option instead, or route to a
+     *             different endpoint with {@code toD} when the destination 
varies per message.
+     */
     @Metadata(description = "The target of the client. See: 
https://grpc.github.io/grpc-java/javadoc/io/grpc/Grpc.html#newChannelBuilder%28java.lang.String,io.grpc.ChannelCredentials%29";,
-              javaType = "String")
+              javaType = "String",
+              deprecationNote = "Never read by the component. The gRPC channel 
is built once when the endpoint is"
+                                + " initialised, so it cannot be redirected 
per exchange. Use the target endpoint option.")
+    @Deprecated
     String TARGET = "CamelTensorFlowServingTarget";
 
-    @Metadata(description = "The credentials of the client.", javaType = 
"io.grpc.ChannelCredentials")
+    /**
+     * @deprecated Never read by the component. The gRPC channel is built once 
when the endpoint is initialised, so it
+     *             cannot be re-authenticated per exchange. Use the {@code 
credentials} endpoint option instead.
+     */
+    @Metadata(description = "The credentials of the client.", javaType = 
"io.grpc.ChannelCredentials",
+              deprecationNote = "Never read by the component. The gRPC channel 
is built once when the endpoint is"
+                                + " initialised, so it cannot be 
re-authenticated per exchange. Use the credentials"
+                                + " endpoint option.")
+    @Deprecated
     String CREDENTIALS = "CamelTensorFlowServingCredentials";
 
     @Metadata(description = "Required servable name.", javaType = "String")
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
index 6f66a5feafce..b3b24f7dca1b 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
@@ -1734,6 +1734,22 @@ two names differed, that header never carried a usable 
`DataHandler` in the firs
 names happened to be equal did it resolve, and then the name is unchanged. A 
route that expected the
 attachment header under the uploaded file name should read it under the 
multipart field name.
 
+=== camel-tensorflow-serving - the Target and Credentials headers are 
deprecated
+
+`TensorFlowServingConstants.TARGET` (`CamelTensorFlowServingTarget`) and
+`TensorFlowServingConstants.CREDENTIALS` (`CamelTensorFlowServingCredentials`) 
are deprecated. Both
+were declared with `@Metadata` and advertised through the endpoint's 
`headersClass`, but neither has
+ever been read by the component.
+
+The gRPC channel and its stubs are built once in 
`TensorFlowServingEndpoint.doInit()` from
+`configuration.getTarget()` and `configuration.getCredentials()`, so a 
per-exchange override supplied
+as a header cannot take effect. A route that set either header was silently 
ignored. The sibling
+`camel-kserve` component declares neither.
+
+Configure the `target` and `credentials` endpoint options instead, or route to 
a different endpoint
+with `toD` when the destination varies per message. The constants remain in 
place for backwards
+compatibility and are now marked deprecated in the component metadata.
+
 === camel-vertx-http - the REST producer applies the outbound header filter
 
 `VertxHttpRestHeaderFilterStrategy.applyFilterToCamelHeaders` delegated to
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TensorFlowServingEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TensorFlowServingEndpointBuilderFactory.java
index 818bb6fa8e2a..fecb15ff309f 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TensorFlowServingEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TensorFlowServingEndpointBuilderFactory.java
@@ -299,7 +299,7 @@ public interface TensorFlowServingEndpointBuilderFactory {
 
         /**
          * The target of the client. See:
-         * 
https://grpc.github.io/grpc-java/javadoc/io/grpc/Grpc.html#newChannelBuilder%28java.lang.String,io.grpc.ChannelCredentials%29.
+         * 
https://grpc.github.io/grpc-java/javadoc/io/grpc/Grpc.html#newChannelBuilder%28java.lang.String,io.grpc.ChannelCredentials%29.
 Deprecation note: Never read by the component. The gRPC channel is built once 
when the endpoint is initialised, so it cannot be redirected per exchange. Use 
the target endpoint option.
          * 
          * The option is a: {@code String} type.
          * 
@@ -307,11 +307,15 @@ public interface TensorFlowServingEndpointBuilderFactory {
          * 
          * @return the name of the header {@code TensorFlowServingTarget}.
          */
+        @Deprecated
         public String tensorFlowServingTarget() {
             return "CamelTensorFlowServingTarget";
         }
         /**
-         * The credentials of the client.
+         * The credentials of the client. Deprecation note: Never read by the
+         * component. The gRPC channel is built once when the endpoint is
+         * initialised, so it cannot be re-authenticated per exchange. Use the
+         * credentials endpoint option.
          * 
          * The option is a: {@code io.grpc.ChannelCredentials} type.
          * 
@@ -319,6 +323,7 @@ public interface TensorFlowServingEndpointBuilderFactory {
          * 
          * @return the name of the header {@code TensorFlowServingCredentials}.
          */
+        @Deprecated
         public String tensorFlowServingCredentials() {
             return "CamelTensorFlowServingCredentials";
         }

Reply via email to