This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch faq in repository https://gitbox.apache.org/repos/asf/camel.git
commit ffcc74fab23aac831a1612d3714edb463621f234 Author: Claus Ibsen <[email protected]> AuthorDate: Tue Mar 3 20:02:26 2026 +0100 CAMEL-16861: Cleanup docs --- docs/user-manual/modules/ROOT/pages/routes.adoc | 45 ++++++++++++ docs/user-manual/modules/faq/nav.adoc | 6 -- ...an-i-create-a-custom-component-or-endpoint.adoc | 5 -- ...en-consuming-for-example-from-a-ftp-server.adoc | 25 ------- ...how-do-i-import-rests-from-other-xml-files.adoc | 85 ---------------------- ...ow-do-i-import-routes-from-other-xml-files.adoc | 44 ----------- ...ow-do-i-make-my-jms-endpoint-transactional.adoc | 25 ------- .../modules/faq/pages/how-do-i-name-my-routes.adoc | 32 -------- docs/user-manual/modules/faq/pages/index.adoc | 6 -- 9 files changed, 45 insertions(+), 228 deletions(-) diff --git a/docs/user-manual/modules/ROOT/pages/routes.adoc b/docs/user-manual/modules/ROOT/pages/routes.adoc index 13fdc400842b..db45fb736e46 100644 --- a/docs/user-manual/modules/ROOT/pages/routes.adoc +++ b/docs/user-manual/modules/ROOT/pages/routes.adoc @@ -44,6 +44,51 @@ YAML:: ---- ==== +== Naming routes + +You can assign names to your routes in Java DSL using `routeId`: + +[tabs] +==== + +Java:: ++ +In Java DSL you use `routeId` to declare the name/id of the route. ++ +[source,java] +---- +from("ftp:myserver/folder").routeId("myRoute") + .to("activemq:queue:cheese"); +---- + +XML:: ++ +In XML DSL you use `id` in the `<route>` element to declare the name/id of the route. ++ +[source,xml] +---- +<route id="myRoute"> + <from uri="ftp:myserver/folder"/> + <to uri="activemq:queue:cheese"/> +</route> +---- + +YAML:: ++ +In YAML DSL you use `id` in the `- route` node to declare the name/id of the route. ++ +[source,yaml] +---- +- route: + id: myRoute + from: + uri: ftp:myserver/folder + steps: + - to: + uri: activemq:queue:cheese +---- +==== + == Route Description and Notes diff --git a/docs/user-manual/modules/faq/nav.adoc b/docs/user-manual/modules/faq/nav.adoc index 89ff48ab5ff0..ed1c71db55b9 100644 --- a/docs/user-manual/modules/faq/nav.adoc +++ b/docs/user-manual/modules/faq/nav.adoc @@ -14,13 +14,8 @@ ** xref:what-platforms-are-supported.adoc[What platforms are supported?] ** xref:why-the-name-camel.adoc[Why the name Camel?] ** xref:how-do-i-specify-which-method-to-use-when-using-beans-in-routes.adoc[How do I specify which method to use when using beans in routes?] -** xref:how-can-i-create-a-custom-component-or-endpoint.adoc[How can I create a custom component or endpoint?] ** xref:how-does-camel-look-up-beans-and-endpoints.adoc[How does Camel look up beans and endpoints?] -** xref:how-do-i-handle-failures-when-consuming-for-example-from-a-ftp-server.adoc[How do I handle failures when consuming for example from a FTP server?] -** xref:how-do-i-import-rests-from-other-xml-files.adoc[How do I import rests from other XML files?] -** xref:how-do-i-import-routes-from-other-xml-files.adoc[How do I import routes from other XML files?] ** xref:how-do-i-let-jetty-match-wildcards.adoc[How do I let Jetty match wildcards?] -** xref:how-do-i-name-my-routes.adoc[How do I name my routes?] ** xref:how-do-i-restart-camelcontext.adoc[How do I restart CamelContext?] ** xref:how-do-i-retrieve-the-thrown-exception-during-processing-an-exchange.adoc[How do I retrieve the thrown Exception during processing an Exchange?] ** xref:how-do-i-retry-failed-messages-forever.adoc[How do I retry failed messages forever?] @@ -48,7 +43,6 @@ ** xref:why-is-the-exception-null-when-i-use-onexception.adoc[Why is the exception null when I use onException?] ** xref:why-use-multiple-camelcontext.adoc[Why use multiple CamelContext?] ** xref:how-do-i-use-log4j.adoc[How do I use log4j?] -** xref:how-do-i-make-my-jms-endpoint-transactional.adoc[How Do I Make My JMS Endpoint Transactional?] ** xref:how-do-i-set-the-mep-when-interacting-with-jbi.adoc[How do I set the MEP when interacting with JBI?] ** xref:how-do-the-direct-event-seda-and-vm-endpoints-compare.adoc[How do the direct, event, seda and vm endpoints compare?] ** xref:how-do-the-timer-and-quartz-endpoints-compare.adoc[How do the Timer and Quartz endpoints compare?] diff --git a/docs/user-manual/modules/faq/pages/how-can-i-create-a-custom-component-or-endpoint.adoc b/docs/user-manual/modules/faq/pages/how-can-i-create-a-custom-component-or-endpoint.adoc deleted file mode 100644 index 842db5c355d3..000000000000 --- a/docs/user-manual/modules/faq/pages/how-can-i-create-a-custom-component-or-endpoint.adoc +++ /dev/null @@ -1,5 +0,0 @@ -= How can I create a custom component or endpoint? - -Please read xref:ROOT:writing-components.adoc[Writing Components] for a -background in how to implement a new component or endpoint. - diff --git a/docs/user-manual/modules/faq/pages/how-do-i-handle-failures-when-consuming-for-example-from-a-ftp-server.adoc b/docs/user-manual/modules/faq/pages/how-do-i-handle-failures-when-consuming-for-example-from-a-ftp-server.adoc deleted file mode 100644 index c617d8d723f7..000000000000 --- a/docs/user-manual/modules/faq/pages/how-do-i-handle-failures-when-consuming-for-example-from-a-ftp-server.adoc +++ /dev/null @@ -1,25 +0,0 @@ -= How do I handle failures when consuming for example from a FTP server? - -When you do a route such as: - -[source,java] ----- -from("ftp://[email protected]?password=secret").to("bean:logic?method=doSomething"); ----- - -And there is a failure with connecting to the remote FTP server. The -existing xref:ROOT:error-handler.adoc[error handler] is -based on when a message is *being* routed. -In this case the error occurs *before* a message has been initiated and -routed. So how can I control the error handling? - -The xref:components::ftp-component.adoc[FTP] component have a few options -(`maximumReconnectAttempts, reconnectDelay` to control number of retries -and delay in between. - -But you can also plugin your own implementation and determine what to do -using the `pollStrategy` option which has more documentation -xref:components:eips:polling-consumer.adoc[Polling Consumer]. -Notice that the option `pollStrategy` applies for all consumers which is -a `ScheduledPollConsumer` consumer. The page lists those. - diff --git a/docs/user-manual/modules/faq/pages/how-do-i-import-rests-from-other-xml-files.adoc b/docs/user-manual/modules/faq/pages/how-do-i-import-rests-from-other-xml-files.adoc deleted file mode 100644 index 5c7ebe719f33..000000000000 --- a/docs/user-manual/modules/faq/pages/how-do-i-import-rests-from-other-xml-files.adoc +++ /dev/null @@ -1,85 +0,0 @@ -= How do I import rests from other XML files? - -*Since Camel 2.14* - -When defining rests in Camel using Spring XML you may want to define some rests in other XML files. For -example you may have many rest services and it may help to maintain the -application if some of the rests are in separate XML files. You may also -want to store common and reusable rests in other XML files, which you -can simply import when needed. - -This is possible to define rests outside `<camelContext/>` which you do -in a new `<restContext/>` tag. - -[NOTE] -==== -When you use `<restContext>` then they are separated, and cannot -reuse existing `<onException>`, `<intercept>`, `<dataFormats>` and similar -cross cutting functionality defined in the `<camelContext>`. In other -words the `<restContext>` is currently isolated. This may change in Camel -3.x. -==== - -For example we could have a file named `myCoolRests.xml` which contains -a rest (can have more) as shown: - -[source,xml] ----- - <restContext id="myCoolRest" xmlns="http://camel.apache.org/schema/spring"> - <rest path="/say/hello"> - <get> - <to uri="direct:hello"/> - </get> - </rest> - </restContext> ----- - -Then in your XML file which contains the CamelContext you can use Spring -to import the `myCoolRests.xml` file. -And then inside `<camelContext/>` you can refer to the -`<restContext/>` using the `<restContextRef>` by its id as shown below: - -[source,xml] ----- - <camelContext xmlns="http://camel.apache.org/schema/spring"> - - <restContextRef ref="myCoolRest"/> - - <rest path="/say/bye"> - <get consumes="application/json"> - <to uri="direct:bye"/> - </get> - <post> - <to uri="mock:update"/> - </post> - </rest> - - <route> - <from uri="direct:hello"/> - <transform> - <constant>Hello World</constant> - </transform> - </route> - <route> - <from uri="direct:bye"/> - <transform> - <constant>Bye World</constant> - </transform> - </route> - </camelContext> ----- - -Also notice that you can mix and match, having rests inside CamelContext -and also externalized in RestContext. - -You can have as many `<restContextRef/>` as you like. - -[TIP] -==== -**Reusable rests** - -The rests defined in `<restContext/>` can be reused by multiple -`<camelContext/>`. However its only the definition which is reused. At -runtime each CamelContext will create its own instance of the rest based -on the definition. -==== diff --git a/docs/user-manual/modules/faq/pages/how-do-i-import-routes-from-other-xml-files.adoc b/docs/user-manual/modules/faq/pages/how-do-i-import-routes-from-other-xml-files.adoc deleted file mode 100644 index b17b627a46f5..000000000000 --- a/docs/user-manual/modules/faq/pages/how-do-i-import-routes-from-other-xml-files.adoc +++ /dev/null @@ -1,44 +0,0 @@ -= How Do I Import Routes From Other XML Files? - -*Since Camel 2.3* - -When defining routes in Camel using Spring XML -you may want to define some routes in other XML files. -For example, you may have many routes, and it may help to maintain the -application if some routes are in separate XML files. You may -also want to store common and reusable routes in other XML files, which -you can simply import when needed. - -In *Camel 2.3* it is now possible to define routes outside -`<camelContext/>` which you do in a new `<routeContext/>` tag. - -[NOTE] -==== -When you use `<routeContext>` then they are separated, and -cannot reuse existing `<onException>`, -`<intercept>`, `<dataFormats>` and similar cross-cutting -functionality defined in the `<camelContext>`. In other words -the `<routeContext>` is currently isolated. This may change in Camel -3.x. -==== - -For example, we could have a file named `myCoolRoutes.xml` which -contains a couple of routes as shown in https://github.com/apache/camel/tree/main/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/config/myCoolRoutes.xml[this example]. - - -Then in your XML file which contains the CamelContext you can use Spring to -import the `myCoolRoute.xml` file. And then inside `<camelContext/>` -you can refer to the `<routeContext/>` by its `id` as shown below in https://github.com/apache/camel/tree/main/components/camel-spring-parent/camel-spring-xml/src/test/resources/org/apache/camel/spring/config/RouteRefIncludeXmlFileTest.xml[this example]. - - -Also notice that you can mix and match, having routes inside `CamelContext` -and also externalized in `RouteContext`. - -You can have as many `<routeContextRef/>` as you like. - -== Reusable routes - -The routes defined in `<routeContext/>` can be reused by multiple -`<camelContext/>`. However, it is only the definition which is reused. At -runtime each `CamelContext` will create its own instance of the route -based on the definition. diff --git a/docs/user-manual/modules/faq/pages/how-do-i-make-my-jms-endpoint-transactional.adoc b/docs/user-manual/modules/faq/pages/how-do-i-make-my-jms-endpoint-transactional.adoc deleted file mode 100644 index 5d05cb44aa92..000000000000 --- a/docs/user-manual/modules/faq/pages/how-do-i-make-my-jms-endpoint-transactional.adoc +++ /dev/null @@ -1,25 +0,0 @@ -= How Do I Make My JMS Endpoint Transactional? - -I have a JMS route like this: - -[source,java] ----- -from("activemq:Some.Queue") - .bean(MyProcessor.class); ----- - -[[HowDoIMakeMyJMSEndpointTransactional-Question]] -== Question: - -How Do I Make It Transactional? - -[[HowDoIMakeMyJMSEndpointTransactional-Answer]] -== Answer: - -There are examples in the xref:components:eips:transactional-client.adoc[Transactional Client] -and it is described in the _Enabling Transacted Consumption_ -section of xref:components::jms-component.adoc[JMS]. To make a session transactional -set `transacted=true` flag on the JMS endpoint and configure -a `transactionManager` on the xref:ROOT:component.adoc[Component] or -xref:ROOT:endpoint.adoc[Endpoint]. - diff --git a/docs/user-manual/modules/faq/pages/how-do-i-name-my-routes.adoc b/docs/user-manual/modules/faq/pages/how-do-i-name-my-routes.adoc deleted file mode 100644 index 855d18aa0792..000000000000 --- a/docs/user-manual/modules/faq/pages/how-do-i-name-my-routes.adoc +++ /dev/null @@ -1,32 +0,0 @@ -= How do I name my routes? - -You can assign names to your routes in Java DSL using `routeId`: - -[source,java] ----- -from("direct:start").routeId("myRoute") - .to(mock:bar); ----- - -And in Spring XML using the `id` attribute: - -[source,xml] ----- -<route id="myRoute"> - <from uri="direct:start"/> - <to uri="mock:bar"/> -</route> ----- - -Same example for YAML using the `id` attribute: - -[source,yaml] ----- -- route: - id: myRoute - from: - uri: direct:start - steps: - - to: - uri: mock:bar ----- diff --git a/docs/user-manual/modules/faq/pages/index.adoc b/docs/user-manual/modules/faq/pages/index.adoc index 460b84ab2416..d2932e1bf467 100644 --- a/docs/user-manual/modules/faq/pages/index.adoc +++ b/docs/user-manual/modules/faq/pages/index.adoc @@ -35,13 +35,8 @@ General questions about Camel Questions on using Apache Camel * xref:how-do-i-specify-which-method-to-use-when-using-beans-in-routes.adoc[How do I specify which method to use when using beans in routes?] -* xref:how-can-i-create-a-custom-component-or-endpoint.adoc[How can I create a custom component or endpoint?] * xref:how-does-camel-look-up-beans-and-endpoints.adoc[How does Camel look up beans and endpoints?] -* xref:how-do-i-handle-failures-when-consuming-for-example-from-a-ftp-server.adoc[How do I handle failures when consuming for example from a FTP server?] -* xref:how-do-i-import-rests-from-other-xml-files.adoc[How do I import rests from other XML files?] -* xref:how-do-i-import-routes-from-other-xml-files.adoc[How do I import routes from other XML files?] * xref:how-do-i-let-jetty-match-wildcards.adoc[How do I let Jetty match wildcards?] -* xref:how-do-i-name-my-routes.adoc[How do I name my routes?] * xref:how-do-i-restart-camelcontext.adoc[How do I restart CamelContext?] * xref:how-do-i-retrieve-the-thrown-exception-during-processing-an-exchange.adoc[How do I retrieve the thrown Exception during processing an Exchange?] * xref:how-do-i-retry-failed-messages-forever.adoc[How do I retry failed messages forever?] @@ -84,7 +79,6 @@ xref:components::log-component.adoc[Log] endpoint or JDK 1.4 logging or Log4j et Questions on using the various Camel xref:components::index.adoc[Components] and xref:ROOT:endpoint.adoc[Endpoint] implementations -* xref:how-do-i-make-my-jms-endpoint-transactional.adoc[How Do I Make My JMS Endpoint Transactional?] * xref:how-do-i-set-the-mep-when-interacting-with-jbi.adoc[How do I set the MEP when interacting with JBI?] * xref:how-do-the-direct-event-seda-and-vm-endpoints-compare.adoc[How do the direct, event, seda and vm endpoints compare?] * xref:how-do-the-timer-and-quartz-endpoints-compare.adoc[How do the Timer and Quartz endpoints compare?]
