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 15151e373579 CAMEL-16861: Update docs
15151e373579 is described below
commit 15151e373579a904a225937a0abb437b9a9248e7
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Feb 19 13:43:45 2026 +0100
CAMEL-16861: Update docs
---
.../modules/ROOT/pages/architecture.adoc | 21 ++
.../modules/ROOT/pages/bean-injection.adoc | 9 +
.../modules/ROOT/pages/camel-catalog.adoc | 2 +-
.../modules/ROOT/pages/camel-maven-archetypes.adoc | 13 +-
.../ROOT/pages/camel-upgrade-recipes-tool.adoc | 2 +-
.../ROOT/pages/camelcontext-autoconfigure.adoc | 8 +-
.../modules/ROOT/pages/camelcontext.adoc | 43 ++--
...ing-route-startup-ordering-and-autostartup.adoc | 236 ++++++++++++++++++---
8 files changed, 269 insertions(+), 65 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/architecture.adoc
b/docs/user-manual/modules/ROOT/pages/architecture.adoc
index 8d52d2935f42..9470534bcdfe 100644
--- a/docs/user-manual/modules/ROOT/pages/architecture.adoc
+++ b/docs/user-manual/modules/ROOT/pages/architecture.adoc
@@ -37,3 +37,24 @@ public class MyRoute extends RouteBuilder {
}
----
+You can also use xref:components:others:java-xml-io-dsl.adoc[XML DSL] to
_code_ the xref:routes.adoc[routes].
+
+[source,xml]
+----
+<route>
+ <from uri="ftp:myserver/folder"/>
+ <to uri="activemq:queue:cheese"/>
+</route>
+----
+
+For low-code users then xref:components:others:yaml-dsl.adoc[YAML DSL] is also
possible:
+
+[source,yaml]
+----
+- route:
+ from:
+ uri: ftp:myserver/folder
+ steps:
+ - to:
+ uri: activemq:queue:cheese
+----
diff --git a/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
b/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
index 80948da5a8ab..62f0f6b2f13b 100644
--- a/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
+++ b/docs/user-manual/modules/ROOT/pages/bean-injection.adoc
@@ -24,6 +24,15 @@ xref:registry.adoc[Registry] such as in a Spring XML file:
<bean id="foo" class="com.foo.MyFooBean"/>
----
+Or in YAML DSL:
+
+[source,yaml]
+----
+- beans:
+ - name: foo
+ type: com.foo.MyFooBean
+----
+
And then in a Java `RouteBuilder` class, you can inject the bean using
`@BeanInject` as shown below:
diff --git a/docs/user-manual/modules/ROOT/pages/camel-catalog.adoc
b/docs/user-manual/modules/ROOT/pages/camel-catalog.adoc
index 4925668d4ee9..2b6624033418 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-catalog.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-catalog.adoc
@@ -50,8 +50,8 @@ org
├── components (JSON schema)
├── dataformats (JSON schema)
├── dev-consoles (JSON schema)
- ├── languages (JSON schema)
├── jbang (JSON schema)
+ ├── languages (JSON schema)
├── main (JSON schema)
├── models (JSON schema)
├── models-app (JSON schema)
diff --git a/docs/user-manual/modules/ROOT/pages/camel-maven-archetypes.adoc
b/docs/user-manual/modules/ROOT/pages/camel-maven-archetypes.adoc
index d358bffe7804..b970ec1b8482 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-maven-archetypes.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-maven-archetypes.adoc
@@ -4,7 +4,7 @@ Camel is distributed with the following archetypes for Maven
end users.
== Archetype Supported
-[width="100%",cols="50%,50%",options="header",]
+[width="100%",cols="1,2",options="header",]
|=======================================================================
|Archetype |Description
@@ -16,10 +16,6 @@ there is an API component missing in Camel that you want to
create yourself.
Maven project for Camel xref:components::index.adoc[Components]. Use this if
there is a component missing in Camel that you want to create yourself.
-|camel-archetype-cdi |This archetype is used to create a
-new Maven project for Camel routes in the Java Container using CDI to
-configure components, endpoints and beans.
-
|camel-archetype-dataformat |This archetype is used for
creating a new Maven project for Camel xref:data-format.adoc[Data
Format]s. Use this if there is a data format missing in Camel that you
@@ -37,9 +33,6 @@ create a new Maven project for XML DSL routes using Spring.
|camel-archetype-spring-boot |This archetype is used to
create a new Maven project for Camel routes using Spring Boot.
-|camel-archetype-endpointdsl |This archetype is used to
-create a new Maven project for Camel routes using Endpoint DSL.
-
|=======================================================================
The maven coordinates for these archetypes is the following:
@@ -58,14 +51,14 @@ The maven coordinates for these archetypes is the following:
If you would like to use an archetype from an unreleased version of
Camel, you just need to let the maven-archetype-plugin know where to
look for it. For example, say someone wanted to create a Java based
-project based on Camel 3.21.0-SNAPSHOT. He'd need to use the following command
+project based on Camel 4.19.0-SNAPSHOT. He'd need to use the following command
[source,bash]
----
mvn archetype:generate \
-DarchetypeGroupId=org.apache.camel.archetypes \
-DarchetypeArtifactId=camel-archetype-java \
- -DarchetypeVersion=3.21.0-SNAPSHOT
+ -DarchetypeVersion=4.19.0-SNAPSHOT
----
When the project is created, you may need to add another repository to
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-upgrade-recipes-tool.adoc
b/docs/user-manual/modules/ROOT/pages/camel-upgrade-recipes-tool.adoc
index 2beca3526d0c..6eb45c99dc43 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-upgrade-recipes-tool.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-upgrade-recipes-tool.adoc
@@ -22,7 +22,7 @@ $ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run
-Drewrite.recipeArtifact
or use camel-jbang xref:camel-jbang.adoc#_update[update] action:
-[source,bas]
+[source,bash]
----
$ camel update run $VERSION
----
\ No newline at end of file
diff --git
a/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc
b/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc
index cf4168613558..1b926348da80 100644
--- a/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc
@@ -30,7 +30,7 @@ The services can be anything that can be plugged into Camel
(typically services
The following SPI services can only a single instance (singleton) be in the
xref:registry.adoc[Registry].
[width="100%",cols="2m,8",options="header",]
-|=======================================================================
+|===
|SPI |Description
| AsyncProcessorAwaitManager | To use a custom async processor await manager
| BacklogTracer | To use a custom backlog tracer
@@ -57,12 +57,12 @@ The following SPI services can only a single instance
(singleton) be in the xref
| ThreadPoolFactory | To use a custom xref:threading-model.adoc[thread pool
factory]
| UnitOfWorkFactory | To use a custom unit of work factory
| UuidGenerator | To use a custom xref:uuidgenerator.adoc[uuid generator]
-|=======================================================================
+|===
For the following SPI services, there can be multiple (one or more)
implementations in the xref:registry.adoc[Registry].
[width="100%",cols="2m,8",options="header",]
-|=======================================================================
+|===
|SPIs |Description
| CamelClusterService | Adds all the custom xref:clustering.adoc[camel-cluster
services]
| EndpointStrategy | Adds all the custom xref:endpoint.adoc[endpoint
strategies]
@@ -76,4 +76,4 @@ For the following SPI services, there can be multiple (one or
more) implementati
| ServiceRegistry | Adds all the custom camel-cloud service registries
| ThreadPoolProfile | Adds all the xref:threading-model.adoc[thread pool
profiles]
| TypeConverters | Adds all the custom xref:type-converter.adoc[type
converters]
-|=======================================================================
+|===
diff --git a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
index 1d708470643f..07004b7218f7 100644
--- a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
@@ -11,7 +11,7 @@ The `CamelContext` provides access to many features and
services, the most notab
The following table lists the most common services provided by the
`CamelContext`:
[width="100%",cols="50%,50%",options="header",]
-|=======================================================================
+|===
|Service |Description
|xref:component.adoc[Components] | Contains the components used.
|xref:endpoint.adoc[Endpoints] | Contains the endpoints that have been used.
@@ -20,7 +20,7 @@ The following table lists the most common services provided
by the `CamelContext
|xref:languages.adoc[Languages] | Contains the loaded languages.
|xref:type-converter.adoc[Type converters] | Contains the loaded type
converters. Camel has a mechanism that allows you to manually or automatically
convert from one type to another.
|xref:registry.adoc[Registry] | Contains a registry that allows you to look up
beans.
-|=======================================================================
+|===
== CamelContext 101
@@ -50,9 +50,16 @@ Routes have one and only one input source for messages. They
are effectively tie
To wire processors and endpoints together to form routes, Camel defines a
xref:dsl.adoc[DSL].
In Camel with Java, DSL means a fluent Java API that contains methods named
for EIP terms.
+Camel provides multiple DSL languages. You could define the same route using
the XML and YAML DSL as well.
-Consider this example:
+Here, in a single Java statement, you define a route that consumes files from
a xref:components::file-component.adoc[file] endpoint.
+Camel uses the xref:components:eips:filter-eip.adoc[Filter EIP] to route the
messages using an XPath predicate to test whether the message is not a test
order. If a message passes the test, Camel forwards it to the
xref:components::jms-component.adoc[JMS] endpoint. Messages failing the filter
test are skipped.
+[tabs]
+====
+
+Java::
++
[source,java]
----
from("file:data/inbox")
@@ -60,11 +67,8 @@ from("file:data/inbox")
.to("jms:queue:order");
----
-Here, in a single Java statement, you define a route that consumes files from
a xref:components::file-component.adoc[file] endpoint.
-Camel uses the xref:components:eips:filter-eip.adoc[Filter EIP] to route the
messages using an XPath predicate to test whether the message is not a test
order. If a message passes the test, Camel forwards it to the
xref:components::jms-component.adoc[JMS] endpoint. Messages failing the filter
test are skipped.
-
-Camel provides multiple DSL languages. You could define the same route using
the XML DSL:
-
+XML::
++
[source,xml]
----
<route>
@@ -76,18 +80,23 @@ Camel provides multiple DSL languages. You could define the
same route using the
</route>
----
-And in YAML:
-
+YAML::
++
[source,yaml]
----
-- from:
- uri: "file:data/inbox"
- steps:
- - filter:
- xpath: "/order[not(@test)]"
- steps:
- - to: "jms:queue:order"
+- route:
+ from:
+ uri: file:data/inbox
+ steps:
+ - filter:
+ expression:
+ xpath:
+ expression: "/order[not(@test)]"
+ steps:
+ - to:
+ uri: jms:queue:order
----
+====
The DSLs provide a nice abstraction for Camel users to build applications.
Under the hood, though, a route is composed of a graph of processors.
diff --git
a/docs/user-manual/modules/ROOT/pages/configuring-route-startup-ordering-and-autostartup.adoc
b/docs/user-manual/modules/ROOT/pages/configuring-route-startup-ordering-and-autostartup.adoc
index 7e80a3fa0188..f567504ec039 100644
---
a/docs/user-manual/modules/ROOT/pages/configuring-route-startup-ordering-and-autostartup.adoc
+++
b/docs/user-manual/modules/ROOT/pages/configuring-route-startup-ordering-and-autostartup.adoc
@@ -60,6 +60,20 @@ should be started when Camel starts. By default, a route is
auto started.
In XML DSL, you disable auto startup as follows:
+
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("activemq:queue:special").autoStartup(false)
+ .to("file://backup");
+----
+
+XML::
++
[source,xml]
----
<route autoStartup="false">
@@ -68,8 +82,35 @@ In XML DSL, you disable auto startup as follows:
</route>
----
+YAML::
++
+[source,yaml]
+----
+- route:
+ autoStartup: "false"
+ from:
+ uri: activemq:queue:special
+ steps:
+ - to:
+ uri: file://backup
+----
+====
+
And to explicit state it should be started:
+[tabs]
+====
+
+Java::
++
+[source,java]
+----
+from("activemq:queue:special").autoStartup(true)
+ .to("file://backup");
+----
+
+XML::
++
[source,xml]
----
<route autoStartup="true">
@@ -78,6 +119,21 @@ And to explicit state it should be started:
</route>
----
+YAML::
++
+[source,yaml]
+----
+- route:
+ autoStartup: "true"
+ from:
+ uri: activemq:queue:special
+ steps:
+ - to:
+ uri: file://backup
+----
+====
+
+
And in Java DSL you can configure auto startup on `CamelContext` as follows:
[source,java]
@@ -85,12 +141,11 @@ And in Java DSL you can configure auto startup on
`CamelContext` as follows:
camelContext.setAutoStartup(false);
----
-And on route level you can disable it via `noAutoStartup`:
+Or in `application.properties`:
-[source,java]
+[source,properties]
----
-from("activemq:queue:special").noAutoStartup()
- .to("file://backup");
+camel.main.auto-startup = false
----
To startup based on a boolean, String or
@@ -156,6 +211,11 @@ Let's try a couple of examples.
=== Startup ordering example
+[tabs]
+====
+
+Java::
++
[source,java]
----
from("seda:foo").startupOrder(1)
@@ -165,22 +225,41 @@ from("direct:start").startupOrder(2)
.to("seda:foo");
----
-And the same example with XML DSL:
-
+XML::
++
[source,xml]
----
-<routes>
- <route startupOrder="1">
- <from uri="seda:foo"/>
- <to uri="mock:result"/>
- </route>
+<route startupOrder="1">
+ <from uri="seda:foo"/>
+ <to uri="mock:result"/>
+</route>
- <route startupOrder="2">
- <from uri="direct:start"/>
- <to uri="seda:foo"/>
- </route>
-</routes>
+<route startupOrder="2">
+ <from uri="direct:start"/>
+ <to uri="seda:foo"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ startupOrder: 1
+ from:
+ uri: seda:foo
+ steps:
+ - to:
+ uri: mock:result
+- route:
+ startupOrder: 2
+ from:
+ uri: direct:start
+ steps:
+ - to:
+ uri: seda:foo
----
+====
In this example, we have two routes in which we have started that the
direct:start route should be started *after* the seda:foo route.
@@ -192,6 +271,11 @@ route to be up and running beforehand.
You can also mix and match routes with and without `startupOrder` defined.
The first two routes below have start order defined, and the last route has
not.
+[tabs]
+====
+
+Java::
++
[source,java]
----
from("seda:foo").startupOrder(1)
@@ -204,27 +288,52 @@ from("direct:bar")
.to("seda:bar");
----
-And the same example with XML DSL:
-
+XML::
++
[source,xml]
----
-<routes>
- <route startupOrder="1">
- <from uri="seda:foo"/>
- <to uri="mock:result"/>
- </route>
+<route startupOrder="1">
+ <from uri="seda:foo"/>
+ <to uri="mock:result"/>
+</route>
- <route startupOrder="2">
- <from uri="direct:start"/>
- <to uri="seda:foo"/>
- </route>
+<route startupOrder="2">
+ <from uri="direct:start"/>
+ <to uri="seda:foo"/>
+</route>
- <route>
- <from uri="direct:bar"/>
- <to uri="seda:bar"/>
- </route>
-</routes>
+<route>
+ <from uri="direct:bar"/>
+ <to uri="seda:bar"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ startupOrder: 1
+ from:
+ uri: seda:foo
+ steps:
+ - to:
+ uri: mock:result
+- route:
+ startupOrder: 2
+ from:
+ uri: direct:start
+ steps:
+ - to:
+ uri: seda:foo
+- route:
+ from:
+ uri: direct:bar
+ steps:
+ - to:
+ uri: seda:bar
----
+====
In the route above we have *not* defined a `startupOrder` on the last
route direct:bar in which Camel will auto assign a number for it, in
@@ -238,6 +347,11 @@ the routes which really needs it.
You can use a high number in `startupOrder` to have a specific route startup
last as shown below:
+[tabs]
+====
+
+Java::
++
[source,java]
----
// use auto assigned startup ordering
@@ -253,6 +367,64 @@ from("direct:bar").startupOrder(12345).to("seda:bar");
from("seda:bar").to("mock:other");
----
+XML::
++
+[source,xml]
+----
+ <route>
+ <from uri="direct:start"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ <route startupOrder="1">
+ <from uri="seda:foo"/>
+ <to uri="mock:result"/>
+ </route>
+
+ <route startupOrder="12345">
+ <from uri="direct:bar"/>
+ <to uri="seda:bar"/>
+ </route>
+
+ <route>
+ <from uri="seda:bar"/>
+ <to uri="mock:other"/>
+ </route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - to:
+ uri: seda:foo
+- route:
+ startupOrder: 1
+ from:
+ uri: seda:foo
+ steps:
+ - to:
+ uri: mock:result
+- route:
+ startupOrder: 12345
+ from:
+ uri: direct:bar
+ steps:
+ - to:
+ uri: seda:bar
+- route:
+ from:
+ uri: seda:bar
+ steps:
+ - to:
+ uri: mock:other
+----
+====
+
In the example above, the order of route startups should be:
1. `_seda:foo_`