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 ff036ce678ad CAMEL-24807: Deprecate Pipe (kind: Pipe) support in the
YAML DSL
ff036ce678ad is described below
commit ff036ce678add0651862a739430cd32549ef529b
Author: Urmila Unni <[email protected]>
AuthorDate: Mon Sep 21 22:46:00 2026 +0530
CAMEL-24807: Deprecate Pipe (kind: Pipe) support in the YAML DSL
Loading Camel K kind: Pipe resources (formerly KameletBinding), typically
from a .pipe.yaml file, is deprecated and will be removed in a future
release. YamlRoutesBuilderLoader now logs a deprecation WARN naming the
resource being loaded, preConfigurePipe is marked @Deprecated, and the
pipe.yaml extension carries a deprecation note while continuing to load
existing files.
The YAML DSL page documents the deprecation and the 4.23 upgrade guide
shows the equivalent plain route, which is more expressive (any EIP,
multiple routes per file, error handling, route configuration) and is
what the tooling, catalog and validator work on.
Closes #26682
Co-authored-by: Claude <[email protected]>
---
.../org/apache/camel/catalog/docs/yaml-dsl.adoc | 11 ++++++
.../ROOT/pages/camel-4x-upgrade-guide-4_23.adoc | 40 ++++++++++++++++++++++
.../camel-yaml-dsl/src/main/docs/yaml-dsl.adoc | 11 ++++++
.../camel/dsl/yaml/YamlRoutesBuilderLoader.java | 13 +++++++
4 files changed, 75 insertions(+)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/yaml-dsl.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/yaml-dsl.adoc
index 0f9c094dcc45..1a0fe5a24885 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/yaml-dsl.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/yaml-dsl.adoc
@@ -993,3 +993,14 @@ which demonstrate creating Camel Routes with YAML.
Another way to find examples of YAML DSL is to look in
https://github.com/apache/camel-kamelets[Camel Kamelets]
where each Kamelet is defined using YAML.
+
+
+== Deprecated: Pipe (kind: Pipe) support
+
+The YAML DSL can load Camel K `kind: Pipe` resources (formerly
`KameletBinding`), typically from a
+`.pipe.yaml` file, converting the source, steps and sink into a regular route
when the file is loaded.
+
+This is deprecated and will be removed in a future release. Loading a Pipe
file now logs a deprecation
+warning. Write a plain Camel route instead, which is more expressive (any EIP,
multiple routes per file,
+error handling and route configuration) and is what the tooling, catalog and
validator work on. See the
+xref:manual::camel-4x-upgrade-guide-4_23.adoc[Camel 4.23 upgrade guide] for an
example of the equivalent route.
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
index 046c57203251..1a642e457dce 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
@@ -933,6 +933,46 @@ now reports a top-level `from:` with the form to write,
the way it reports the o
form as well; a Kamelet's `template:` keeps its `from:`, which is the Kamelet
spec's shape. The classic schema and `camel run` are unchanged: the file keeps
working,
with the compact notation warning `camel run` already logged for it.
+=== camel-yaml-dsl - Pipe (kind: Pipe) support is deprecated
+
+Loading Camel K `kind: Pipe` resources (formerly `KameletBinding`), typically
from a `.pipe.yaml` file, is
+deprecated in the YAML DSL and will be removed in a future release. Loading
such a file now logs a deprecation
+warning.
+
+Write a plain Camel route instead, which is more expressive (any EIP, multiple
routes per file, error handling
+and route configuration) and is what the tooling, catalog and validator work
on. For example, a Pipe with a
+source, a step and a sink:
+
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+ name: my-pipe
+spec:
+ source:
+ uri: timer:tick
+ steps:
+ - uri: "https://my-service/api"
+ sink:
+ uri: log:result
+----
+
+becomes:
+
+[source,yaml]
+----
+- route:
+ id: my-pipe
+ from:
+ uri: timer:tick
+ steps:
+ - to:
+ uri: "https://my-service/api"
+ - to:
+ uri: log:result
+----
+
=== camel-mail
`MimeMultipartDataFormat` now uses `MailHeaderFilterStrategy` instead of a
plain
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
index 0f9c094dcc45..1a0fe5a24885 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/docs/yaml-dsl.adoc
@@ -993,3 +993,14 @@ which demonstrate creating Camel Routes with YAML.
Another way to find examples of YAML DSL is to look in
https://github.com/apache/camel-kamelets[Camel Kamelets]
where each Kamelet is defined using YAML.
+
+
+== Deprecated: Pipe (kind: Pipe) support
+
+The YAML DSL can load Camel K `kind: Pipe` resources (formerly
`KameletBinding`), typically from a
+`.pipe.yaml` file, converting the source, steps and sink into a regular route
when the file is loaded.
+
+This is deprecated and will be removed in a future release. Loading a Pipe
file now logs a deprecation
+warning. Write a plain Camel route instead, which is more expressive (any EIP,
multiple routes per file,
+error handling and route configuration) and is what the tooling, catalog and
validator work on. See the
+xref:manual::camel-4x-upgrade-guide-4_23.adoc[Camel 4.23 upgrade guide] for an
example of the equivalent route.
diff --git
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
index 87b35d19718c..d2a1469cde09 100644
---
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
+++
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java
@@ -94,6 +94,8 @@ import static
org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.setDeseri
public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport {
public static final String EXTENSION = "yaml";
+ // Note: the "pipe.yaml" extension (Camel K Pipe / kind: Pipe) is
deprecated and will be removed in a future release;
+ // use a plain Camel route instead.
public static final String[] SUPPORTED_EXTENSION = { EXTENSION,
"camel.yaml", "pipe.yaml" };
private static final Logger LOG =
LoggerFactory.getLogger(YamlRoutesBuilderLoader.class);
@@ -365,6 +367,13 @@ public class YamlRoutesBuilderLoader extends
YamlRoutesBuilderLoaderSupport {
boolean pipe = anyTupleMatches(mn.getValue(), "apiVersion", v ->
v.startsWith(PIPE_VERSION)) &&
anyTupleMatches(mn.getValue(), "kind", "Pipe");
if (pipe) {
+ if (!preParse) {
+ String loc = ctx.getResource() != null ?
ctx.getResource().getLocation() : "";
+ LOG.warn(
+ "Loading Pipe (kind: Pipe) resources with the YAML
DSL is deprecated and will be removed in a future release. "
+ + "Use a plain Camel route instead: {}",
+ loc);
+ }
target = preConfigurePipe(root, ctx, target, preParse);
}
}
@@ -400,7 +409,11 @@ public class YamlRoutesBuilderLoader extends
YamlRoutesBuilderLoaderSupport {
/**
* Pipe file
+ *
+ * @deprecated Pipe support in the YAML DSL is deprecated and will be
removed in a future release; use a plain Camel
+ * route instead.
*/
+ @Deprecated
private Object preConfigurePipe(Node root, YamlDeserializationContext ctx,
Object target, boolean preParse) {
// when in pre-parse phase then we only want to gather
/metadata/annotations