This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch backport/26194-to-camel-4.18.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit d85982d670ad49c952233182470e510761f3fc87 Author: Guillaume Nodet <[email protected]> AuthorDate: Fri Sep 11 08:51:48 2026 +0000 [backport camel-4.18.x] CAMEL-24535: camel-tensorflow-serving - deprecate the Target and Credentials headers --- .../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 c8c83b5f4366..ed70361c85a9 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 @@ -1707,3 +1707,19 @@ Routes that set `useRecovery=false` are unaffected. Routes that left recovery en default, stop seeing in-progress aggregations re-delivered, and start seeing genuine recovery. The cache now also holds one entry per completed and not yet confirmed exchange; those entries are removed on confirmation. + +=== 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. 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"; }
