You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/02/16 10:35:01 UTC
[camel] branch main updated: (chores) docs: refined CamelContext documentation
This is an automated email from the ASF dual-hosted git repository.
orpiske 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 afee765b608 (chores) docs: refined CamelContext documentation
afee765b608 is described below
commit afee765b608fa7ab4606b7488d00953c8bdf89a7
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Feb 16 10:22:18 2023 +0100
(chores) docs: refined CamelContext documentation
---
.../modules/ROOT/pages/camelcontext.adoc | 44 ++++++++--------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
index 3913f8fdf87..c9974bae27a 100644
--- a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
@@ -1,15 +1,14 @@
= CamelContext
-The https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/CamelContext.html[CamelContext]
-is the container that is the runtime Camel. The `CamelContext` is the runtime system, which
-holds everything together as depicted in the figure below.
+The https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/CamelContext.html[CamelContext] is the runtime system, which holds together all the fundamental concepts of Apache Camel (routes, endpoints, components, etc).
+
+This context object represents the Camel runtime system. Typically, you have one _CamelContext_ instance in an application.
image::images/camel-context.png[image]
-The `CamelContext` provides access to many useful services, the most notable
-being components, type converters, a registry, endpoints, routes, data formats, and languages.
+The `CamelContext` provides access to many features and services, the most notable being components, type converters, a registry, endpoints, routes, data formats, and languages.
-The following table lists the most common services provided by `CamelContext`:
+The following table lists the most common services provided by the `CamelContext`:
[width="100%",cols="50%,50%",options="header",]
|=======================================================================
@@ -25,33 +24,26 @@ The following table lists the most common services provided by `CamelContext`:
== CamelContext 101
-To better understand Apache Camel then lets talk a bit more about what is inside the `CamelContext`.
+To give you a better understanding of Apache Camel, we'll discuss what is inside the `CamelContext`.
=== Routing Engine
-Camel’s routing engine is what moves messages under the hood. This engine isn’t
-exposed to the developer, but you should be aware that it’s there and that it does all the
-heavy lifting, ensuring that messages are routed properly.
+Camel's routing engine moves messages under the hood and does all the heavy lifting to ensure that messages are routed properly. It is not exposed to the developer, but you should be aware that it's there.
=== Routes
-xref:routes.adoc[Routes] are a core abstraction for Camel. The simplest way to define a route is
-as a chain of xref:processor.adoc[Processors]. There are many reasons for using routers in messaging applications.
-By decoupling clients from servers, and producers from consumers, routes can
-for example do the following:
+xref:routes.adoc[Routes] are a core abstraction for Camel. The simplest way to define a route is as a chain of xref:processor.adoc[Processors]. There are many reasons for using routers in messaging applications.
+By decoupling clients from servers, and producers from consumers, routes can, for example, do the following:
* Decide dynamically what server a client will invoke
* Provide a flexible way to add extra processing
-* Allow for clients and servers to be developed independently
-* Foster better design practices by connecting disparate systems that do one
-thing well
+* Allow independent development for clients and servers
+* Foster better design practices by connecting disparate systems that do one thing well
* Allow for clients of servers to be stubbed out (using xref:components::mock-component.adoc[mocks]) for testing purposes
-Each route in Camel has a unique identifier that’s used for logging, debugging, monitoring,
-and starting and stopping routes.
+Each route in Camel has a unique identifier. You can use the identifier to log, debug, monitor, and start and stop routes.
-Routes also have exactly one input source for messages,
-so they’re effectively tied to an input xref:endpoint.adoc[endpoint].
+Routes have one and only one input source for messages. They are effectively tied to an input endpoint.
=== Domain Specific Language (DSL)
@@ -69,12 +61,9 @@ from("file:data/inbox")
----
Here, in a single Java statement, you define a route that consumes files from a xref:components::file-component.adoc[file] endpoint.
-Messages are then routed to the xref:components:eips:filter-eip.adoc[Filter] EIP, which will use an XPath predicate to
-test whether the message is not a test order. If a message passes the test, it’s forwarded
-to the xref:components::jms-component.adoc[JMS] endpoint. Messages failing the filter test are skipped.
+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, so you could define the same route by using
-the XML DSL, like this:
+Camel provides multiple DSL languages. You could define the same route using the XML DSL:
[source,xml]
----
@@ -100,8 +89,7 @@ And in YAML:
- to: "jms:queue:order"
----
-The DSLs provide a nice abstraction for Camel users to build applications with. Under
-the hood, though, a route is composed of a graph of processors.
+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.
=== Processors