davsclaus commented on code in PR #26682:
URL: https://github.com/apache/camel/pull/26682#discussion_r4062327635
##########
dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java:
##########
@@ -365,6 +367,11 @@ private Object preConfigureNode(Node root,
YamlDeserializationContext ctx, boole
boolean pipe = anyTupleMatches(mn.getValue(), "apiVersion", v ->
v.startsWith(PIPE_VERSION)) &&
anyTupleMatches(mn.getValue(), "kind", "Pipe");
if (pipe) {
+ if (!preParse) {
+ 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.");
+ }
Review Comment:
The other two WARNs in this class include the resource location, and a user
with several Pipe files would otherwise get identical lines with no pointer to
which file to migrate:
```suggestion
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);
}
```
##########
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
+Camel 4.23 upgrade guide for an example of the equivalent route.
Review Comment:
Docs convention is an `xref:` for internal links rather than prose, so the
reader can click through:
```suggestion
xref:manual::camel-4x-upgrade-guide-4_23.adoc#_camel_yaml_dsl_pipe_kind_pipe_support_is_deprecated[Camel
4.23 upgrade guide] for an example of the equivalent route.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]