CAMEL-11786: Migrate docs to more correct ascii doc format
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a5d3b750 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a5d3b750 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a5d3b750 Branch: refs/heads/master Commit: a5d3b75075cf38c87cd051aaaf7da7fcb39c8941 Parents: b76a55f Author: Claus Ibsen <davscl...@apache.org> Authored: Tue Sep 19 13:31:56 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Tue Sep 19 13:32:52 2017 +0200 ---------------------------------------------------------------------- camel-core/src/main/docs/bean-component.adoc | 6 +- camel-core/src/main/docs/bean-language.adoc | 78 +-- camel-core/src/main/docs/binding-component.adoc | 16 +- camel-core/src/main/docs/browse-component.adoc | 36 +- camel-core/src/main/docs/class-component.adoc | 6 +- camel-core/src/main/docs/constant-language.adoc | 8 +- .../src/main/docs/controlbus-component.adoc | 74 +-- .../src/main/docs/dataformat-component.adoc | 21 +- camel-core/src/main/docs/dataset-component.adoc | 67 ++- camel-core/src/main/docs/direct-component.adoc | 42 +- .../src/main/docs/direct-vm-component.adoc | 45 +- camel-core/src/main/docs/dynamic-router.adoc | 69 +-- .../main/docs/exchangeProperty-language.adoc | 20 +- camel-core/src/main/docs/file-component.adoc | 504 +++++++++---------- camel-core/src/main/docs/file-language.adoc | 98 ++-- camel-core/src/main/docs/gzip-dataformat.adoc | 8 +- camel-core/src/main/docs/header-language.adoc | 6 +- .../src/main/docs/language-component.adoc | 30 +- camel-core/src/main/docs/log-component.adoc | 114 ++--- camel-core/src/main/docs/mock-component.adoc | 10 - .../apache/camel/processor/TrySetFaultTest.java | 9 +- 21 files changed, 556 insertions(+), 711 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/bean-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/bean-component.adoc b/camel-core/src/main/docs/bean-component.adoc index c4ee066..a06134f 100644 --- a/camel-core/src/main/docs/bean-component.adoc +++ b/camel-core/src/main/docs/bean-component.adoc @@ -6,10 +6,10 @@ The *bean:* component binds beans to Camel message exchanges. === URI format -[source,java] ---------------------- +[source] +---- bean:beanName[?options] ---------------------- +---- Where *beanID* can be any string which is used to look up the bean in the link:registry.html[Registry] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/bean-language.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/bean-language.adoc b/camel-core/src/main/docs/bean-language.adoc index e5b4c1e..87aa0c0 100644 --- a/camel-core/src/main/docs/bean-language.adoc +++ b/camel-core/src/main/docs/bean-language.adoc @@ -42,16 +42,16 @@ The Bean method language supports 5 options which are listed below. === Using Bean Expressions from the Java DSL [source,java] ----------------------------------------------- +---- from("activemq:topic:OrdersTopic"). filter().method("myBean", "isGoldCustomer"). to("activemq:BigSpendersQueue"); ----------------------------------------------- +---- === Using Bean Expressions from XML [source,xml] --------------------------------------------------- +---- <route> <from uri="activemq:topic:OrdersTopic"/> <filter> @@ -59,11 +59,9 @@ from("activemq:topic:OrdersTopic"). <to uri="activemq:BigSpendersQueue"/> </filter> </route> --------------------------------------------------- +---- -*Bean attribute now deprecated* - -Note, the `bean` attribute of the method expression element is now +CAUTION: Bean attribute is now deprecated. The `bean` attribute of the method expression element is now deprecated. You should now make use of `ref` attribute instead. === Writing the expression bean @@ -75,28 +73,32 @@ converted to a *boolean* value in this case, as its used as a predicate. So we could implement it like this... [source,java] ----------------------------------------------------- +---- public class MyBean { public boolean isGoldCustomer(Exchange exchange) { ... } } ----------------------------------------------------- +---- We can also use the link:bean-integration.html[Bean Integration] annotations. For example you could do... [source,java] ------------------------------------------------- -public boolean isGoldCustomer(String body) {...} ------------------------------------------------- +---- +public boolean isGoldCustomer(String body) { + // do something +} +---- or [source,java] ----------------------------------------------------------------------------- -public boolean isGoldCustomer(@Header(name = "foo") Integer fooHeader) {...} ----------------------------------------------------------------------------- +---- +public boolean isGoldCustomer(@Header(name = "foo") Integer fooHeader) { + // do something +} +---- So you can bind parameters of the method to the Exchange, the link:message.html[Message] or individual headers, properties, the body @@ -115,11 +117,11 @@ invoke an already existing instance. This is illustrated from the example below: [source,java] ----------------------------------------------------------------------------------- - from("activemq:topic:OrdersTopic"). - filter().expression(BeanLanguage(MyBean.class, "isGoldCustomer")). - to("activemq:BigSpendersQueue"); ----------------------------------------------------------------------------------- +---- +from("activemq:topic:OrdersTopic"). + filter().expression(BeanLanguage(MyBean.class, "isGoldCustomer")). + to("activemq:BigSpendersQueue"); +---- The 2nd parameter `isGoldCustomer` is an optional parameter to explicit set the method name to invoke. If not provided Camel will try to invoke @@ -129,36 +131,36 @@ Also the code is more readable if the method name is provided. The 1st parameter can also be an existing instance of a Bean such as: [source,java] ------------------------------------------------------------------------------ - private MyBean my; +---- +private MyBean my; - from("activemq:topic:OrdersTopic"). - filter().expression(BeanLanguage.bean(my, "isGoldCustomer")). - to("activemq:BigSpendersQueue"); ------------------------------------------------------------------------------ + from("activemq:topic:OrdersTopic"). + filter().expression(BeanLanguage.bean(my, "isGoldCustomer")). + to("activemq:BigSpendersQueue"); +---- In Camel 2.2 onwards you can avoid the `BeanLanguage` and have it just as: [source,java] ----------------------------------------------------------------- - private MyBean my; +---- +private MyBean my; - from("activemq:topic:OrdersTopic"). - filter().expression(bean(my, "isGoldCustomer")). - to("activemq:BigSpendersQueue"); ----------------------------------------------------------------- + from("activemq:topic:OrdersTopic"). + filter().expression(bean(my, "isGoldCustomer")). + to("activemq:BigSpendersQueue"); +---- Which also can be done in a bit shorter and nice way: [source,java] ------------------------------------------------------- - private MyBean my; +---- +private MyBean my; - from("activemq:topic:OrdersTopic"). - filter().method(my, "isGoldCustomer"). - to("activemq:BigSpendersQueue"); ------------------------------------------------------- + from("activemq:topic:OrdersTopic"). + filter().method(my, "isGoldCustomer"). + to("activemq:BigSpendersQueue"); +---- === Dependencies http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/binding-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/binding-component.adoc b/camel-core/src/main/docs/binding-component.adoc index b4a11c1..000472c 100644 --- a/camel-core/src/main/docs/binding-component.adoc +++ b/camel-core/src/main/docs/binding-component.adoc @@ -70,9 +70,9 @@ You can prefix any endpoint URI with *binding:nameOfBinding:* where _nameOfBinding_ is the name of the Binding bean in your registry. [source,java] ------------------------------------------------------------------------------- +---- from("binding:jaxb:activemq:myQueue").to("binding:jaxb:activemq:anotherQueue") ------------------------------------------------------------------------------- +---- Here we are using the "jaxb" binding which may, for example, use the JAXB link:data-format.html[Data Format] to marshal and unmarshal @@ -89,17 +89,17 @@ For example if you registered a new component called "jsonmq" in your registry using code like this [source,java] ------------------------------------------------------------------------------------------------------ - JacksonDataFormat format = new JacksonDataFormat(MyBean.class); - context.bind("jsonmq", new BindingComponent(new DataFormatBinding(format), "activemq:foo.")); ------------------------------------------------------------------------------------------------------ +---- +JacksonDataFormat format = new JacksonDataFormat(MyBean.class); +context.bind("jsonmq", new BindingComponent(new DataFormatBinding(format), "activemq:foo.")); +---- Then you could use the endpoint as if it were any other endpoint. [source,java] ------------------------------------------------- +---- from("jsonmq:myQueue").to("jsonmq:anotherQueue") ------------------------------------------------- +---- which would be using the queueus "foo.myQueue" and "foo.anotherQueue" and would use the given Jackson link:data-format.html[Data Format] to http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/browse-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/browse-component.adoc b/camel-core/src/main/docs/browse-component.adoc index 8d93760..ae52527 100644 --- a/camel-core/src/main/docs/browse-component.adoc +++ b/camel-core/src/main/docs/browse-component.adoc @@ -9,7 +9,7 @@ endpoint are all available to be browsed. === URI format -[source,java] +[source] ------------------------- browse:someName[?options] ------------------------- @@ -62,27 +62,27 @@ In the route below, we insert a `browse:` component to be able to browse the Exchanges that are passing through: [source,java] -------------------------------------------------------------------------------- - from("activemq:order.in").to("browse:orderReceived").to("bean:processOrder"); -------------------------------------------------------------------------------- +---- +from("activemq:order.in").to("browse:orderReceived").to("bean:processOrder"); +---- We can now inspect the received exchanges from within the Java code: [source,java] --------------------------------------------------------------------------------------------------------- - private CamelContext context; - - public void inspectRecievedOrders() { - BrowsableEndpoint browse = context.getEndpoint("browse:orderReceived", BrowsableEndpoint.class); - List<Exchange> exchanges = browse.getExchanges(); - ... - // then we can inspect the list of received exchanges from Java - for (Exchange exchange : exchanges) { - String payload = exchange.getIn().getBody(); - ... - } - } --------------------------------------------------------------------------------------------------------- +---- +private CamelContext context; + +public void inspectRecievedOrders() { + BrowsableEndpoint browse = context.getEndpoint("browse:orderReceived", BrowsableEndpoint.class); + List<Exchange> exchanges = browse.getExchanges(); + + // then we can inspect the list of received exchanges from Java + for (Exchange exchange : exchanges) { + String payload = exchange.getIn().getBody(); + // do something with payload + } +} +---- === See Also http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/class-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/class-component.adoc b/camel-core/src/main/docs/class-component.adoc index 4821225..d7af051 100644 --- a/camel-core/src/main/docs/class-component.adoc +++ b/camel-core/src/main/docs/class-component.adoc @@ -9,10 +9,10 @@ based on the class name. === URI format -[source,java] -------------------------- +[source] +---- class:className[?options] -------------------------- +---- Where *className* is the fully qualified class name to create and use as bean. http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/constant-language.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/constant-language.adoc b/camel-core/src/main/docs/constant-language.adoc index b63ad2d..a056734 100644 --- a/camel-core/src/main/docs/constant-language.adoc +++ b/camel-core/src/main/docs/constant-language.adoc @@ -27,7 +27,7 @@ The setHeader element of the Spring DSL can utilize a constant expression like: [source,xml] ------------------------------------------- +---- <route> <from uri="seda:a"/> <setHeader headerName="theHeader"> @@ -35,7 +35,7 @@ expression like: </setHeader> <to uri="mock:b"/> </route> ------------------------------------------- +---- in this case, the link:message.html[Message] coming from the seda:a link:endpoint.html[Endpoint] will have 'theHeader' header set to the @@ -44,9 +44,9 @@ constant value 'the value'. And the same example using Java DSL: [source,java] --------------------------------------------------------------------------- +---- from("seda:a").setHeader("theHeader", constant("the value")).to("mock:b"); --------------------------------------------------------------------------- +---- === Dependencies http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/controlbus-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/controlbus-component.adoc b/camel-core/src/main/docs/controlbus-component.adoc index a5dedfc..b0d9799 100644 --- a/camel-core/src/main/docs/controlbus-component.adoc +++ b/camel-core/src/main/docs/controlbus-component.adoc @@ -1,7 +1,6 @@ -== Control Bus Component -=== ControlBus -*Available as of Camel version 2.11.0* +== Control Bus +*Available as of Camel version 2.11.0* The http://www.eaipatterns.com/ControlBus.html[Control Bus] from the link:enterprise-integration-patterns.html[EIP patterns] allows for the @@ -37,10 +36,10 @@ For example, by sending a message to an link:endpoint.html[Endpoint] you can control the lifecycle of routes, or gather performance statistics. -[source,java] ----------------------------- +[source] +---- controlbus:command[?options] ----------------------------- +---- Where *command* can be any string to identify which type of command to use. @@ -48,7 +47,7 @@ use. === Commands [width="100%",cols="10%,90%",options="header",] -|======================================================================= +|=== |Command |Description |`route` |To control routes using the `routeId` and `action` parameter. @@ -56,7 +55,7 @@ use. |`language` |Allows you to specify a link:language.html[Language] to use for evaluating the message body. If there is any result from the evaluation, then the result is put in the message body. -|======================================================================= +|=== === Options @@ -104,26 +103,26 @@ You can append query options to the URI in the following format, === Samples -#=== Using route command +=== Using route command The route command allows you to do common tasks on a given route very easily, for example to start a route, you can send an empty message to this endpoint: [source,java] ---------------------------------------------------------------------- +---- template.sendBody("controlbus:route?routeId=foo&action=start", null); ---------------------------------------------------------------------- +---- To get the status of the route, you can do: [source,java] -------------------------------------------------------------------------------------------------------- +---- String status = template.requestBody("controlbus:route?routeId=foo&action=status", null, String.class); -------------------------------------------------------------------------------------------------------- +---- [[ControlBus-Gettingperformancestatistics]] -Getting performance statistics +=== Getting performance statistics *Available as of Camel 2.11.1* @@ -133,9 +132,9 @@ link:camelcontext.html[CamelContext]. For example to get the statics for a route named foo, we can do: [source,java] ---------------------------------------------------------------------------------------------------- +---- String xml = template.requestBody("controlbus:route?routeId=foo&action=stats", null, String.class); ---------------------------------------------------------------------------------------------------- +---- The returned statics is in XML format. Its the same data you can get from JMX with the `dumpRouteStatsAsXml` operation on the @@ -145,11 +144,11 @@ To get statics for the entire link:camelcontext.html[CamelContext] you just omit the routeId parameter as shown below: [source,java] ---------------------------------------------------------------------------------------- +---- String xml = template.requestBody("controlbus:route?action=stats", null, String.class); ---------------------------------------------------------------------------------------- +---- -#=== Using link:simple.html[Simple] language +=== Using Simple language You can use the link:simple.html[Simple] language with the control bus, for example to stop a specific route, you can send a message to the @@ -157,19 +156,19 @@ for example to stop a specific route, you can send a message to the message: [source,java] ----------------------------------------------------------------------------------------- +---- template.sendBody("controlbus:language:simple", "${camelContext.stopRoute('myRoute')}"); ----------------------------------------------------------------------------------------- +---- As this is a void operation, no result is returned. However, if you want the route status you can do: [source,java] ------------------------------------------------------------------------------------------------------------------------------- +---- String status = template.requestBody("controlbus:language:simple", "${camelContext.getRouteStatus('myRoute')}", String.class); ------------------------------------------------------------------------------------------------------------------------------- +---- -*Notice:* its easier to use the `route` command to control lifecycle of +It's easier to use the `route` command to control lifecycle of routes. The `language` command allows you to execute a language script that has stronger powers such as link:groovy.html[Groovy] or to some extend the link:simple.html[Simple] language. @@ -177,32 +176,13 @@ extend the link:simple.html[Simple] language. For example to shutdown Camel itself you can do: [source,java] -------------------------------------------------------------------------------------- +---- template.sendBody("controlbus:language:simple?async=true", "${camelContext.stop()}"); -------------------------------------------------------------------------------------- +---- -Notice we use `async=true` to stop Camel asynchronously as otherwise we +We use `async=true` to stop Camel asynchronously as otherwise we would be trying to stop Camel while it was in-flight processing the message we sent to the control bus component. -TIP:You can also use other languages such as link:groovy.html[Groovy], etc. - -=== See Also - -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] - -* link:controlbus.html[ControlBus] EIP -* link:jmx.html[JMX] Component -* Using link:camel-jmx.html[JMX] with Camel - -#=== Using This Pattern +TIP: You can also use other languages such as link:groovy.html[Groovy], etc. -If you would like to use this EIP Pattern then please read the -link:getting-started.html[Getting Started], you may also find the -link:architecture.html[Architecture] useful particularly the description -of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could -try out some of the link:examples.html[Examples] first before trying -this pattern out. http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/dataformat-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/dataformat-component.adoc b/camel-core/src/main/docs/dataformat-component.adoc index f8eda87..b3fac1f 100644 --- a/camel-core/src/main/docs/dataformat-component.adoc +++ b/camel-core/src/main/docs/dataformat-component.adoc @@ -7,10 +7,10 @@ Format] as a Camel link:component.html[Component]. === URI format -[source,java] ---------------------------------------------- +[source] +---- dataformat:name:(marshal|unmarshal)[?options] ---------------------------------------------- +---- Where *name* is the name of the link:data-format.html[Data Format]. And then followed by the operation which must either be `marshal` or @@ -61,16 +61,16 @@ For example to use the link:jaxb.html[JAXB] link:data-format.html[Data Format] we can do as follows: [source,java] -------------------------------------------------------------- +---- from("activemq:My.Queue"). to("dataformat:jaxb:unmarshal?contextPath=com.acme.model"). to("mqseries:Another.Queue"); -------------------------------------------------------------- +---- And in XML DSL you do: [source,xml] ------------------------------------------------------------------------ +---- <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="activemq:My.Queue"/> @@ -78,12 +78,5 @@ And in XML DSL you do: <to uri="mqseries:Another.Queue"/> </route> </camelContext> ------------------------------------------------------------------------ - -=== See Also +---- -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] -* link:data-format.html[Data Format] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/dataset-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/dataset-component.adoc b/camel-core/src/main/docs/dataset-component.adoc index 9d67503..70ab6d6 100644 --- a/camel-core/src/main/docs/dataset-component.adoc +++ b/camel-core/src/main/docs/dataset-component.adoc @@ -22,10 +22,10 @@ dataset's. === URI format -[source,java] ----------------------- +[source] +---- dataset:name[?options] ----------------------- +---- Where *name* is used to find the http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/component/dataset/DataSet.html[DataSet @@ -104,11 +104,11 @@ implementing the DataSet interface. So you can register your own DataSet as: [source,xml] --------------------------------------------------------- - <bean id="myDataSet" class="com.mycompany.MyDataSet"> - <property name="size" value="100"/> - </bean> --------------------------------------------------------- +---- +<bean id="myDataSet" class="com.mycompany.MyDataSet"> + <property name="size" value="100"/> +</bean> +---- === Example @@ -116,13 +116,13 @@ For example, to test that a set of messages are sent to a queue and then consumed from the queue without losing any messages: [source,java] ---------------------------------------------------------- +---- // send the dataset to a queue from("dataset:foo").to("activemq:SomeQueue"); // now lets test that the messages are consumed correctly from("activemq:SomeQueue").to("dataset:foo"); ---------------------------------------------------------- +---- The above would look in the link:registry.html[Registry] to find the *foo* DataSet instance which is used to create the messages. @@ -130,17 +130,17 @@ The above would look in the link:registry.html[Registry] to find the Then you create a DataSet implementation, such as using the `SimpleDataSet` as described below, configuring things like how big the data set is and what the messages look like etc.  -  -=== `DataSetSupport` (abstract class) +=== DataSetSupport (abstract class) The DataSetSupport abstract class is a nice starting point for new DataSets, and provides some useful features to derived classes. -=== Properties on DataSetSupport +==== Properties on DataSetSupport + [width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= +|=== |Property |Type |Default |Description |`defaultHeaders` |`Map<String,Object>` |`null` |Specifies the default message body. For SimpleDataSet it is a constant @@ -154,16 +154,16 @@ create your own derivation of `DataSetSupport`. |`reportCount` |`long` |`-1` |Specifies the number of messages to be received before reporting progress. Useful for showing progress of a large load test. If < 0, then `size` / 5, if is 0 then `size`, else set to `reportCount` value. -|======================================================================= +|=== -=== `SimpleDataSet` +=== SimpleDataSet The `SimpleDataSet` extends `DataSetSupport`, and adds a default body. -=== Additional Properties on SimpleDataSet +==== Additional Properties on SimpleDataSet [width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= +|=== |Property |Type |Default |Description |`defaultBody` |`Object` |`<hello>world!</hello>` |Specifies the default message body. By default, the `SimpleDataSet` @@ -171,17 +171,19 @@ produces the same constant payload for each exchange. If you want to customize the payload for each exchange, create a Camel `Processor` and configure the `SimpleDataSet` to use it by setting the `outputTransformer` property. -|======================================================================= +|=== -=== `ListDataSet (Camel 2.17)` +=== ListDataSet + +*Available since Camel 2.17* The List`DataSet` extends `DataSetSupport`, and adds a list of default bodies. -=== Additional Properties on ListDataSet +==== Additional Properties on ListDataSet [width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= +|=== |Property |Type |Default |Description |`defaultBodies` |`List<Object>` |`empty LinkedList<Object>` |Specifies the default message body. By default, the `ListDataSet` @@ -197,29 +199,24 @@ used. If the value is greater than the size of the `defaultBodies` list, the payload for the exchange will be selected using the modulus of the `CamelDataSetIndex` and the size of the `defaultBodies` list (i.e. `CamelDataSetIndex % defaultBodies.size()` ) -|======================================================================= +|=== + +=== FileDataSet -=== FileDataSet (Camel 2.17) +*Available since Camel 2.17* -The `SimpleDataSet` extends `ListDataSet`, and adds support for loading +The `FileDataSet` extends `ListDataSet`, and adds support for loading the bodies from a file. -=== Additional Properties on FileDataSet +==== Additional Properties on FileDataSet [width="100%",cols="10%,10%,10%,70%",options="header",] -|======================================================================= +|=== |Property |Type |Default |Description |`sourceFile` |`File` |null |Specifies the source file for payloads |`delimiter` |`String` |\z |Specifies the delimiter pattern used by a `java.util.Scanner` to split the file into multiple payloads. -|======================================================================= - -=== See Also +|=== -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] -* link:spring-testing.html[Spring Testing] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/direct-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/direct-component.adoc b/camel-core/src/main/docs/direct-component.adoc index 3c82183..4c035b6 100644 --- a/camel-core/src/main/docs/direct-component.adoc +++ b/camel-core/src/main/docs/direct-component.adoc @@ -11,16 +11,16 @@ TIP: *Asynchronous* The link:seda.html[SEDA] component provides asynchronous invocation of any consumers when a producer sends a message exchange. -TIP:*Connection to other camel contexts* +TIP: *Connection to other camel contexts* The link:vm.html[VM] component provides connections between Camel contexts as long they run in the same *JVM*. === URI format -[source,text] -------------------------- +[source] +---- direct:someName[?options] -------------------------- +---- Where *someName* can be any string to uniquely identify the endpoint @@ -84,7 +84,7 @@ In the route below we use the direct component to link the two routes together: [source,java] -------------------------------------------- +---- from("activemq:queue:order.in") .to("bean:orderServer?method=validate") .to("direct:processOrder"); @@ -92,33 +92,29 @@ from("activemq:queue:order.in") from("direct:processOrder") .to("bean:orderService?method=process") .to("activemq:queue:order.out"); -------------------------------------------- +---- And the sample using spring DSL: [source,xml] --------------------------------------------------- - <route> - <from uri="activemq:queue:order.in"/> - <to uri="bean:orderService?method=validate"/> - <to uri="direct:processOrder"/> - </route> - - <route> - <from uri="direct:processOrder"/> - <to uri="bean:orderService?method=process"/> - <to uri="activemq:queue:order.out"/> - </route> --------------------------------------------------- +---- +<route> + <from uri="activemq:queue:order.in"/> + <to uri="bean:orderService?method=validate"/> + <to uri="direct:processOrder"/> +</route> + +<route> + <from uri="direct:processOrder"/> + <to uri="bean:orderService?method=process"/> + <to uri="activemq:queue:order.out"/> +</route> +---- See also samples from the link:seda.html[SEDA] component, how they can be used together. === See Also -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] * link:seda.html[SEDA] * link:vm.html[VM] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/direct-vm-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/direct-vm-component.adoc b/camel-core/src/main/docs/direct-vm-component.adoc index d000a08..d6f7b21 100644 --- a/camel-core/src/main/docs/direct-vm-component.adoc +++ b/camel-core/src/main/docs/direct-vm-component.adoc @@ -28,10 +28,10 @@ image:direct-vm.data/camel-direct-vm.png[image] === URI format -[source,java] ------------------- +[source] +---- direct-vm:someName ------------------- +---- Where *someName* can be any string to uniquely identify the endpoint @@ -99,45 +99,40 @@ In the route below we use the direct component to link the two routes together: [source,java] -------------------------------------------- +---- from("activemq:queue:order.in") .to("bean:orderServer?method=validate") .to("direct-vm:processOrder"); -------------------------------------------- +---- And now in another CamelContext, such as another OSGi bundle [source,java] -------------------------------------------- +---- from("direct-vm:processOrder") .to("bean:orderService?method=process") .to("activemq:queue:order.out"); -------------------------------------------- +---- And the sample using spring DSL: [source,xml] --------------------------------------------------- - <route> - <from uri="activemq:queue:order.in"/> - <to uri="bean:orderService?method=validate"/> - <to uri="direct-vm:processOrder"/> - </route> - - <route> - <from uri="direct-vm:processOrder"/> - <to uri="bean:orderService?method=process"/> - <to uri="activemq:queue:order.out"/> - </route> --------------------------------------------------- +---- +<route> + <from uri="activemq:queue:order.in"/> + <to uri="bean:orderService?method=validate"/> + <to uri="direct-vm:processOrder"/> +</route> + +<route> + <from uri="direct-vm:processOrder"/> + <to uri="bean:orderService?method=process"/> + <to uri="activemq:queue:order.out"/> +</route> +---- === See Also -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] - * link:direct.html[Direct] * link:seda.html[SEDA] * link:vm.html[VM] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/dynamic-router.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/dynamic-router.adoc b/camel-core/src/main/docs/dynamic-router.adoc index e97b900..638f326 100644 --- a/camel-core/src/main/docs/dynamic-router.adoc +++ b/camel-core/src/main/docs/dynamic-router.adoc @@ -1,6 +1,5 @@ [[DynamicRouter-DynamicRouter]] -Dynamic Router -~~~~~~~~~~~~~~ +== Dynamic Router The http://www.enterpriseintegrationpatterns.com/DynamicRouter.html[Dynamic @@ -20,8 +19,7 @@ bean, will return `null` to indicate the end. Otherwise the `dynamicRouter` will keep repeating endlessly. [[DynamicRouter-Options]] -Options -^^^^^^^ +=== Options [width="100%",cols="10%,10%,80%",options="header",] |======================================================================= @@ -41,8 +39,7 @@ value to -1 allows to turn off the cache all together. |======================================================================= [[DynamicRouter-DynamicRouterinCamel2.5onwards]] -Dynamic Router in Camel 2.5 onwards -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +=== Dynamic Router in Camel 2.5 onwards From Camel 2.5 the link:dynamic-router.html[Dynamic Router] will set a property (Exchange.SLIP_ENDPOINT) on the link:exchange.html[Exchange] @@ -52,23 +49,22 @@ because the link:dynamic-router.html[Dynamic Router] implementation is based on top of link:routing-slip.html[Routing Slip]). [[DynamicRouter-JavaDSL]] -Java DSL -++++++++ +=== Java DSL In Java DSL you can use the `dynamicRouter` as shown below: [source,java] ------------------------------------------------------------------------------------------------------------------------ +---- from("direct:start") // use a bean as the dynamic router .dynamicRouter(method(DynamicRouterTest.class, "slip")); ------------------------------------------------------------------------------------------------------------------------ +---- Which will leverage a link:bean.html[Bean] to compute the slip _on-the-fly_, which could be implemented as follows: [source,java] ------------------------------------------------------------------------------------------------------------------------ +---- /** * Use this method to compute dynamic where we should route next. * @@ -92,7 +88,7 @@ public String slip(String body) { // no more so return null return null; } ------------------------------------------------------------------------------------------------------------------------ +---- Mind that this example is only for show and tell. The current implementation is not thread safe. You would have to store the state on @@ -100,7 +96,7 @@ the link:exchange.html[Exchange], to ensure thread safety, as shown below: [source,java] ------------------------------------------------------------------------------------------------------------------------ +---- /** * Use this method to compute dynamic where we should route next. * @@ -135,7 +131,7 @@ public String slip(String body, @Properties Map<String, Object> properties) { // no more so return null return null; } ------------------------------------------------------------------------------------------------------------------------ +---- You could also store state as message headers, but they are not guaranteed to be preserved during routing, where as properties on the @@ -149,13 +145,12 @@ link:processor.html[Processor] instead. This is fixed in Camel 2.9.3 onwards. [[DynamicRouter-SpringXML]] -Spring XML -++++++++++ +=== Spring XML The same example in Spring XML would be: [source,xml] ------------------------------------------------------------------------------------------------------------------------ +---- <bean id="mySlip" class="org.apache.camel.processor.DynamicRouterTest"/> <camelContext xmlns="http://camel.apache.org/schema/spring"> @@ -173,11 +168,10 @@ The same example in Spring XML would be: </route> </camelContext> ------------------------------------------------------------------------------------------------------------------------ +---- [[DynamicRouter-DynamicRouterannotation]] -@DynamicRouter annotation -+++++++++++++++++++++++++ +=== @DynamicRouter annotation You can also use the `@DynamicRouter` annotation, for example the Camel 2.4 example below could be written as follows. The `route` method would @@ -188,7 +182,7 @@ the link:routing-slip.html[Routing Slip], where each endpoint is separated by a delimiter. [source,java] ------------------------------------------------------------------------------------------------------------------------ +---- public class MyDynamicRouter { @Consume(uri = "activemq:foo") @@ -198,28 +192,7 @@ public class MyDynamicRouter { // return the next endpoint uri, where to go. Return null to indicate the end. } } ------------------------------------------------------------------------------------------------------------------------ - -[[DynamicRouter-DynamicRouterinCamel2.4orolder]] -Dynamic Router in Camel 2.4 or older -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The simplest way to implement this is to use the -link:recipientlist-annotation.html[RecipientList Annotation] on a Bean -method to determine where to route the message. - -[source,java] ------------------------------------------------------------------------------------------------------------------------------ -public class MyDynamicRouter { - - @Consume(uri = "activemq:foo") - @RecipientList - public List<String> route(@XPath("/customer/id") String customerId, @Header("Location") String location, Document body) { - // query a database to find the best match of the endpoint based on the input parameteres - ... - } -} ------------------------------------------------------------------------------------------------------------------------------ +---- In the above we can use the link:parameter-binding-annotations.html[Parameter Binding Annotations] @@ -234,13 +207,3 @@ link:bean-integration.html[Bean Integration] such as * link:spring-remoting.html[Spring Remoting] * link:bean.html[Bean] component -[[DynamicRouter-UsingThisPattern]] -Using This Pattern -++++++++++++++++++ - -If you would like to use this EIP Pattern then please read the -link:getting-started.html[Getting Started], you may also find the -link:architecture.html[Architecture] useful particularly the description -of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could -try out some of the link:examples.html[Examples] first before trying -this pattern out. http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/exchangeProperty-language.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/exchangeProperty-language.adoc b/camel-core/src/main/docs/exchangeProperty-language.adoc index 4437333..1c58370 100644 --- a/camel-core/src/main/docs/exchangeProperty-language.adoc +++ b/camel-core/src/main/docs/exchangeProperty-language.adoc @@ -27,26 +27,22 @@ exchangeProperty expression like: In this case, the list of recipients are contained in the property 'myProperty'. -[source,java] ---------------------------------------------------- +[source,xml] +---- <route> <from uri="direct:a" /> <recipientList> <exchangeProperty>myProperty</exchangeProperty> </recipientList> </route> ---------------------------------------------------- - - +---- And the same example in Java DSL: [source,java] ---------------------------------------------------------------- +---- from("direct:a").recipientList(exchangeProperty("myProperty")); ---------------------------------------------------------------- - - +---- And with a slightly different syntax where you use the builder to the fullest (i.e. avoid using parameters but using stacked operations, @@ -54,9 +50,9 @@ notice that exchangeProperty is not a parameter but a stacked method call) [source,java] ------------------------------------------------------------------- - from("direct:a").recipientList().exchangeProperty("myProperty"); ------------------------------------------------------------------- +---- +from("direct:a").recipientList().exchangeProperty("myProperty"); +---- === Dependencies http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/file-component.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/file-component.adoc b/camel-core/src/main/docs/file-component.adoc index 66934da..8aa0247 100644 --- a/camel-core/src/main/docs/file-component.adoc +++ b/camel-core/src/main/docs/file-component.adoc @@ -8,17 +8,17 @@ messages from other components to be saved to disk. === URI format -[source,java] ----------------------------- +[source] +---- file:directoryName[?options] ----------------------------- +---- or -[source,java] ------------------------------- +[source] +---- file://directoryName[?options] ------------------------------- +---- Where *directoryName* represents the underlying file directory. @@ -35,10 +35,8 @@ option, e.g. by setting `fileName=thefilename`. + $\{ } placeholders. Again use the `fileName` option to specify the dynamic part of the filename. -WARNING:*Avoid reading files currently being written by another -application* - -Beware the JDK File IO API is a bit limited in detecting whether another +WARNING: *Avoid reading files currently being written by another +application* Beware the JDK File IO API is a bit limited in detecting whether another application is currently writing/copying a file. And the implementation can be different depending on OS platform as well. This could lead to that Camel thinks the file is not locked by another process and start @@ -49,16 +47,11 @@ _Consuming files from folders where others drop files directly_. === URI Options -#=== File2 Options - - // component options: START The File component has no options. // component options: END - - // endpoint options: START The File endpoint is configured using URI syntax: @@ -165,11 +158,7 @@ with the following path and query parameters: // endpoint options: END - -#=== Default behavior for file producer - -* By default it will override any existing file, if one exist with the -same name. +TIP: *Default behavior for file producer* By default it will override any existing file, if one exist with the same name. === Move and Delete operations @@ -180,9 +169,9 @@ is still located in the inbox folder. Lets illustrate this with an example: [source,java] ------------------------------------------------------------ - from("file://inbox?move=.done").to("bean:handleOrder"); ------------------------------------------------------------ +---- +from("file://inbox?move=.done").to("bean:handleOrder"); +---- When a file is dropped in the `inbox` folder, the file consumer notices this and creates a new `FileExchange` that is routed to the @@ -196,10 +185,10 @@ The *move* and the *preMove* options are considered as a directory name Language], or link:simple.html[Simple] then the result of the expression evaluation is the file name to be used - eg if you set -[source,java] ------------------------------------ +[source] +---- move=../backup/copy-of-${file:name} ------------------------------------ +---- then that's using the link:file-language.html[File Language] which we use return the file name to be used), which can be either relative or @@ -212,30 +201,30 @@ relative to the directory where the file was consumed. If you want to delete the file after processing, the route should be: [source,java] -------------------------------------------------------------- - from("file://inobox?delete=true").to("bean:handleOrder"); -------------------------------------------------------------- +---- +from("file://inobox?delete=true").to("bean:handleOrder"); +---- We have introduced a *pre* move operation to move files *before* they are processed. This allows you to mark which files have been scanned as they are moved to this sub folder before being processed. [source,java] -------------------------------------------------------------------- - from("file://inbox?preMove=inprogress").to("bean:handleOrder"); -------------------------------------------------------------------- +---- +from("file://inbox?preMove=inprogress").to("bean:handleOrder"); +---- You can combine the *pre* move and the regular move: [source,java] ------------------------------------------------------------------------------- - from("file://inbox?preMove=inprogress&move=.done").to("bean:handleOrder"); ------------------------------------------------------------------------------- +---- +from("file://inbox?preMove=inprogress&move=.done").to("bean:handleOrder"); +---- So in this situation, the file is in the `inprogress` folder when being processed and after it's processed, it's moved to the `.done` folder. -#=== Fine grained control over Move and PreMove option +=== Fine grained control over Move and PreMove option The *move* and *preMove* options are link:expression.html[Expression]-based, so we have the full power of @@ -252,12 +241,12 @@ you have the full power. So if we want to move the file into a backup folder with today's date as the pattern, we can do: -[source,java] ---------------------------------------------- +[source] +---- move=backup/${date:now:yyyyMMdd}/${file:name} ---------------------------------------------- +---- -#=== About moveFailed +=== About moveFailed The `moveFailed` option allows you to move files that *could not* be processed succesfully to another location such as a error folder of your @@ -271,10 +260,10 @@ See more examples at link:file-language.html[File Language] The following headers are supported by this component: -#=== File producer only +==== File producer only [width="100%",cols="10%,90%",options="header",] -|======================================================================= +|=== |Header |Description |`CamelFileName` |Specifies the name of the file to write (relative to the endpoint @@ -293,12 +282,12 @@ value instead (but only once, as the producer will remove this header after writing the file). The value can be only be a String. Notice that if the option `fileName` has been configured, then this is still being evaluated. -|======================================================================= +|=== -#=== File consumer only +==== File consumer only [width="100%",cols="10%,90%",options="header",] -|======================================================================= +|=== |Header |Description |`CamelFileName` |Name of the consumed file as a relative file path with offset from the @@ -326,13 +315,13 @@ relative filename. For absolute files this is the absolute path. |`CamelFileLastModified` |A `Long` value containing the last modified timestamp of the file. In *Camel 2.10.3 and older* the type is `Date`. -|======================================================================= +|=== === Batch Consumer This component implements the link:batch-consumer.html[Batch Consumer]. -#=== Exchange Properties, file consumer only +=== Exchange Properties, file consumer only As the file consumer implements the `BatchConsumer` it supports batching the files it polls. By batching we mean that Camel will add the @@ -341,7 +330,7 @@ you know the number of files polled, the current index, and whether the batch is already completed. [width="100%",cols="10%,90%",options="header",] -|======================================================================= +|=== |Property |Description |`CamelBatchSize` |The total number of files that was polled in this batch. @@ -350,7 +339,7 @@ batch is already completed. |`CamelBatchComplete` |A `boolean` value indicating the last link:exchange.html[Exchange] in the batch. Is only `true` for the last entry. -|======================================================================= +|=== This allows you for instance to know how many files exist in this batch and for instance let the link:aggregator2.html[Aggregator2] aggregate @@ -364,10 +353,10 @@ both the consumer and producer endpoints. For example if you read utf-8 files, and want to convert the files to iso-8859-1, you can do: [source,java] ---------------------------------------- +---- from("file:inbox?charset=utf-8") .to("file:outbox?charset=iso-8859-1") ---------------------------------------- +---- You can also use the `convertBodyTo` in the route. In the example below we have still input files in utf-8 format, but we want to convert the @@ -376,12 +365,12 @@ process the data. Before writing the content to the outbox folder using the current charset. [source,java] --------------------------------------------- +---- from("file:inbox?charset=utf-8") .convertBodyTo(byte[].class, "iso-8859-1") .to("bean:myBean") .to("file:outbox"); --------------------------------------------- +---- If you omit the charset on the consumer endpoint, then Camel does not know the charset of the file, and would by default use "UTF-8". However @@ -396,12 +385,12 @@ converted to a byte array, and thus would write the content directly as is (without any further encodings). [source,java] --------------------------------------------- +---- from("file:inbox") .convertBodyTo(byte[].class, "iso-8859-1") .to("bean:myBean") .to("file:outbox"); --------------------------------------------- +---- You can also override and control the encoding dynamic when writing files, by setting a property on the exchange with the key @@ -409,13 +398,13 @@ files, by setting a property on the exchange with the key property with a value from a message header. [source,java] ------------------------------------------------------------------- +---- from("file:inbox") .convertBodyTo(byte[].class, "iso-8859-1") .to("bean:myBean") .setProperty(Exchange.CHARSET_NAME, header("someCharsetHeader")) .to("file:outbox"); ------------------------------------------------------------------- +---- We suggest to keep things simpler, so if you pickup files with the same encoding, and want to write the files in a specific encoding, then favor @@ -431,14 +420,14 @@ file using a specific charset. + For example the route below will log the following: [source,java] ---------------------------------------- +---- from("file:inbox?charset=utf-8") .to("file:outbox?charset=iso-8859-1") ---------------------------------------- +---- And the logs: -[source,java] +[source] ---------------------------------------------------------------------------------------------------------------------------------------------- DEBUG GenericFileConverter - Read file /Users/davsclaus/workspace/camel/camel-core/target/charset/input/input.txt with charset utf-8 DEBUG FileOperations - Using Reader to write file: target/charset/output.txt with charset: iso-8859-1 @@ -458,31 +447,31 @@ The sample code below produces files using the message ID as the filename: [source,java] ------------------------------------------------- +---- from("direct:report").to("file:target/reports"); ------------------------------------------------- +---- To use `report.txt` as the filename you have to do: [source,java] -------------------------------------------------------------------------------------------------------- +---- from("direct:report").setHeader(Exchange.FILE_NAME, constant("report.txt")).to( "file:target/reports"); -------------------------------------------------------------------------------------------------------- +---- ... the same as above, but with `CamelFileName`: [source,java] ----------------------------------------------------------------------------------------------------- +---- from("direct:report").setHeader("CamelFileName", constant("report.txt")).to( "file:target/reports"); ----------------------------------------------------------------------------------------------------- +---- And a syntax where we set the filename on the endpoint with the *fileName* URI option. [source,java] ---------------------------------------------------------------------- +---- from("direct:report").to("file:target/reports/?fileName=report.txt"); ---------------------------------------------------------------------- +---- === Filename Expression @@ -516,9 +505,9 @@ If you want only to consume files when a done file exists, then you can use the `doneFileName` option on the endpoint. [source,java] ------------------------------------ +---- from("file:bar?doneFileName=done"); ------------------------------------ +---- Will only consume files from the bar folder, if a done _file_ exists in the same directory as the target files. Camel will automatically delete @@ -534,9 +523,9 @@ must be enclosed in $\{ }. The consumer only supports the static part of the _done file_ name as either prefix or suffix (not both). [source,java] ------------------------------------------------- +---- from("file:bar?doneFileName=${file:name}.done"); ------------------------------------------------- +---- In this example only files will be polled if there exists a done file with the name _file name_.done. For example @@ -547,9 +536,9 @@ with the name _file name_.done. For example You can also use a prefix for the done file, such as: [source,java] -------------------------------------------------- +---- from("file:bar?doneFileName=ready-${file:name}"); -------------------------------------------------- +---- * `hello.txt` - is the file to be consumed * `ready-hello.txt` - is the associated done file @@ -564,9 +553,9 @@ finished and has been written. To do that you can use the `doneFileName` option on the file producer endpoint. [source,java] ----------------------------------- +---- .to("file:bar?doneFileName=done"); ----------------------------------- +---- Will simply create a file named `done` in the same directory as the target file. @@ -578,25 +567,25 @@ following two dynamic tokens: `file:name` and `file:name.noext` which must be enclosed in $\{ }. [source,java] ------------------------------------------------ +---- .to("file:bar?doneFileName=done-${file:name}"); ------------------------------------------------ +---- Will for example create a file named `done-foo.txt` if the target file was `foo.txt` in the same directory as the target file. [source,java] ------------------------------------------------ +---- .to("file:bar?doneFileName=${file:name}.done"); ------------------------------------------------ +---- Will for example create a file named `foo.txt.done` if the target file was `foo.txt` in the same directory as the target file. [source,java] ------------------------------------------------------ +---- .to("file:bar?doneFileName=${file:name.noext}.done"); ------------------------------------------------------ +---- Will for example create a file named `foo.done` if the target file was `foo.txt` in the same directory as the target file. @@ -606,27 +595,27 @@ Will for example create a file named `foo.done` if the target file was #=== Read from a directory and write to another directory [source,java] ------------------------------------------------------------ +---- from("file://inputdir/?delete=true").to("file://outputdir") ------------------------------------------------------------ +---- -#=== Read from a directory and write to another directory using a overrule dynamic name +==== Read from a directory and write to another directory using a overrule dynamic name [source,java] ---------------------------------------------------------------------------------------------- +---- from("file://inputdir/?delete=true").to("file://outputdir?overruleFile=copy-of-${file:name}") ---------------------------------------------------------------------------------------------- +---- Listen on a directory and create a message for each file dropped there. Copy the contents to the `outputdir` and delete the file in the `inputdir`. -#=== Reading recursively from a directory and writing to another +==== Reading recursively from a directory and writing to another [source,java] --------------------------------------------------------------------------- +---- from("file://inputdir/?recursive=true&delete=true").to("file://outputdir") --------------------------------------------------------------------------- +---- Listen on a directory and create a message for each file dropped there. Copy the contents to the `outputdir` and delete the file in the @@ -634,22 +623,22 @@ Copy the contents to the `outputdir` and delete the file in the files in the same directory structure in the `outputdir` as the `inputdir`, including any sub-directories. -[source,java] --------------------- +[source] +---- inputdir/foo.txt inputdir/sub/bar.txt --------------------- +---- Will result in the following output layout: -[source,java] ---------------------- +[source] +---- outputdir/foo.txt outputdir/sub/bar.txt ---------------------- +---- [[File2-Usingflatten]] -Using flatten +=== Using flatten If you want to store the files in the outputdir directory in the same directory, disregarding the source directory layout (e.g. to flatten out @@ -657,94 +646,94 @@ the path), you just add the `flatten=true` option on the file producer side: [source,java] ---------------------------------------------------------------------------------------- +---- from("file://inputdir/?recursive=true&delete=true").to("file://outputdir?flatten=true") ---------------------------------------------------------------------------------------- +---- Will result in the following output layout: -[source,java] ------------------ +[source] +---- outputdir/foo.txt outputdir/bar.txt ------------------ +---- -#=== Reading from a directory and the default move operation +=== Reading from a directory and the default move operation Camel will by default move any processed file into a `.camel` subdirectory in the directory the file was consumed from. [source,java] --------------------------------------------------------------------------- +---- from("file://inputdir/?recursive=true&delete=true").to("file://outputdir") --------------------------------------------------------------------------- +---- Affects the layout as follows: + *before* -[source,java] --------------------- +[source] +---- inputdir/foo.txt inputdir/sub/bar.txt --------------------- +---- *after* -[source,java] ---------------------------- +[source] +---- inputdir/.camel/foo.txt inputdir/sub/.camel/bar.txt outputdir/foo.txt outputdir/sub/bar.txt ---------------------------- +---- -#=== Read from a directory and process the message in java +=== Read from a directory and process the message in java [source,java] ------------------------------------------------------------ +---- from("file://inputdir/").process(new Processor() { public void process(Exchange exchange) throws Exception { Object body = exchange.getIn().getBody(); // do some business logic with the input body } }); ------------------------------------------------------------ +---- The body will be a `File` object that points to the file that was just dropped into the `inputdir` directory. -#=== Writing to files +=== Writing to files Camel is of course also able to write files, i.e. produce files. In the sample below we receive some reports on the SEDA queue that we process before they are being written to a directory. -#=== Write to subdirectory using `Exchange.FILE_NAME` +==== Write to subdirectory using `Exchange.FILE_NAME` Using a single route, it is possible to write a file to any number of subdirectories. If you have a route setup as such: [source,xml] ------------------------------------ - <route> - <from uri="bean:myBean"/> - <to uri="file:/rootDirectory"/> - </route> ------------------------------------ +---- +<route> + <from uri="bean:myBean"/> + <to uri="file:/rootDirectory"/> +</route> +---- You can have `myBean` set the header `Exchange.FILE_NAME` to values such as: -[source,java] --------------------------------------------------------------- +[source] +---- Exchange.FILE_NAME = hello.txt => /rootDirectory/hello.txt Exchange.FILE_NAME = foo/bye.txt => /rootDirectory/foo/bye.txt --------------------------------------------------------------- +---- This allows you to have a single route to write files to multiple destinations. -#=== Writing file through the temporary directory relative to the final destination +==== Writing file through the temporary directory relative to the final destination Sometime you need to temporarily write the files to some directory relative to the destination directory. Such situation usually happens @@ -755,20 +744,20 @@ after data transfer is done, they will be atomically moved to the` /var/myapp/finalDirectory `directory. [source,java] -------------------------------------------------------------------------- +---- from("direct:start"). to("file:///var/myapp/finalDirectory?tempPrefix=/../filesInProgress/"); -------------------------------------------------------------------------- +---- -#=== Using expression for filenames +=== Using expression for filenames In this sample we want to move consumed files to a backup folder using today's date as a sub-folder name: [source,java] ------------------------------------------------------------------------------ +---- from("file://inbox?move=backup/${date:now:yyyyMMdd}/${file:name}").to("..."); ------------------------------------------------------------------------------ +---- See link:file-language.html[File Language] for more samples. @@ -779,9 +768,9 @@ directly within the component so it will skip already processed files. This feature can be enabled by setting the `idempotent=true` option. [source,java] ------------------------------------------------ +---- from("file://inbox?idempotent=true").to("..."); ------------------------------------------------ +---- Camel uses the absolute file name as the idempotent key, to detect duplicate files. From *Camel 2.11* onwards you can customize this key by @@ -789,12 +778,12 @@ using an expression in the idempotentKey option. For example to use both the name and the file size as the key [source,xml] ------------------------------------------------------------------------------------------- - <route> - <from uri="file://inbox?idempotent=true&idempotentKey=${file:name}-${file:size}"/> - <to uri="bean:processInbox"/> - </route> ------------------------------------------------------------------------------------------- +---- +<route> + <from uri="file://inbox?idempotent=true&idempotentKey=${file:name}-${file:size}"/> + <to uri="bean:processInbox"/> +</route> +---- By default Camel uses a in memory based store for keeping track of consumed files, it uses a least recently used cache holding up to 1000 @@ -804,25 +793,25 @@ indicate it's a referring to a bean in the link:registry.html[Registry] with the specified `id`. [source,xml] --------------------------------------------------------------------------------- - <!-- define our store as a plain spring bean --> - <bean id="myStore" class="com.mycompany.MyIdempotentStore"/> +---- + <!-- define our store as a plain spring bean --> + <bean id="myStore" class="com.mycompany.MyIdempotentStore"/> - <route> - <from uri="file://inbox?idempotent=true&idempotentRepository=#myStore"/> - <to uri="bean:processInbox"/> - </route> --------------------------------------------------------------------------------- +<route> + <from uri="file://inbox?idempotent=true&idempotentRepository=#myStore"/> + <to uri="bean:processInbox"/> +</route> +---- Camel will log at `DEBUG` level if it skips a file because it has been consumed before: -[source,java] -------------------------------------------------------------------------------------------------------------------------- +[source] +---- DEBUG FileConsumer is idempotent and the file has been consumed before. Will skip this file: target\idempotent\report.txt -------------------------------------------------------------------------------------------------------------------------- +---- -#=== Using a file based idempotent repository +=== Using a file based idempotent repository In this section we will use the file based idempotent repository `org.apache.camel.processor.idempotent.FileIdempotentRepository` instead @@ -842,7 +831,7 @@ idempotent repository and define our file consumer to use our repository with the `idempotentRepository` using `#` sign to indicate link:registry.html[Registry] lookup: -#=== Using a JPA based idempotent repository +=== Using a JPA based idempotent repository In this section we will use the JPA based idempotent repository instead of the in-memory based that is used as default. @@ -852,7 +841,7 @@ need to use the class `org.apache.camel.processor.idempotent.jpa.MessageProcessed` as model. [source,xml] ---------------------------------------------------------------------------------- +---- <persistence-unit name="idempotentDb" transaction-type="RESOURCE_LOCAL"> <class>org.apache.camel.processor.idempotent.jpa.MessageProcessed</class> @@ -864,13 +853,13 @@ need to use the class <property name="openjpa.Multithreaded" value="true"/> </properties> </persistence-unit> ---------------------------------------------------------------------------------- +---- Next, we can create our JPA idempotent repository in the spring XML file as well: [source,xml] ---------------------------------------------------------------------------------- +---- <!-- we define our jpa based idempotent repository we want to use in the file consumer --> <bean id="jpaStore" class="org.apache.camel.processor.idempotent.jpa.JpaMessageIdRepository"> <!-- Here we refer to the entityManagerFactory --> @@ -879,19 +868,19 @@ XML file as well: You can have different repositories with different names --> <constructor-arg index="1" value="FileConsumer"/> </bean> ---------------------------------------------------------------------------------- +---- And yes then we just need to refer to the *jpaStore* bean in the file consumer endpoint using the `idempotentRepository` using the `#` syntax option: [source,xml] ---------------------------------------------------------------------------------- - <route> - <from uri="file://inbox?idempotent=true&idempotentRepository=#jpaStore"/> - <to uri="bean:processInbox"/> - </route> ---------------------------------------------------------------------------------- +---- +<route> + <from uri="file://inbox?idempotent=true&idempotentRepository=#jpaStore"/> + <to uri="bean:processInbox"/> +</route> +---- === Filter using org.apache.camel.component.file.GenericFileFilter @@ -906,22 +895,17 @@ reference our filter (using `#` notation) that we have defined in the spring XML file: [source,xml] ----------------------------------------------------------- - <!-- define our filter as a plain spring bean --> - <bean id="myFilter" class="com.mycompany.MyFileFilter"/> - - <route> - <from uri="file://inbox?filter=#myFilter"/> - <to uri="bean:processInbox"/> - </route> ----------------------------------------------------------- +---- +<!-- define our filter as a plain spring bean --> +<bean id="myFilter" class="com.mycompany.MyFileFilter"/> -#=== Filtering using ANT path matcher +<route> + <from uri="file://inbox?filter=#myFilter"/> + <to uri="bean:processInbox"/> +</route> +---- -TIP:*New options from Camel 2.10 onwards* -There are now `antInclude` and `antExclude` options to make it easy to -specify ANT style include/exclude without having to define the filter. -See the URI options above for more information. +=== Filtering using ANT path matcher The ANT path matcher is shipped out-of-the-box in the *camel-spring* jar. So you need to depend on *camel-spring* if you are using Maven. + @@ -935,9 +919,14 @@ The file paths is matched with the following rules: * `*` matches zero or more characters * `**` matches zero or more directories in a path +TIP: *New options from Camel 2.10 onwards* +There are now `antInclude` and `antExclude` options to make it easy to +specify ANT style include/exclude without having to define the filter. +See the URI options above for more information. + The sample below demonstrates how to use it: -=== Sorting using Comparator +==== Sorting using Comparator Camel supports pluggable sorting strategies. This strategy it to use the build in `java.util.Comparator` in Java. You can then configure the @@ -952,89 +941,89 @@ reference to our sorter (`mySorter`) we have defined in the spring XML file: [source,xml] ------------------------------------------------------------ - <!-- define our sorter as a plain spring bean --> - <bean id="mySorter" class="com.mycompany.MyFileSorter"/> +---- + <!-- define our sorter as a plain spring bean --> + <bean id="mySorter" class="com.mycompany.MyFileSorter"/> - <route> - <from uri="file://inbox?sorter=#mySorter"/> - <to uri="bean:processInbox"/> - </route> ------------------------------------------------------------ +<route> + <from uri="file://inbox?sorter=#mySorter"/> + <to uri="bean:processInbox"/> +</route> +---- -TIP:*URI options can reference beans using the # syntax* +TIP: *URI options can reference beans using the # syntax* In the Spring DSL route above notice that we can refer to beans in the link:registry.html[Registry] by prefixing the id with `#`. So writing `sorter=#mySorter`, will instruct Camel to go look in the link:registry.html[Registry] for a bean with the ID, `mySorter`. -=== Sorting using sortBy +==== Sorting using sortBy Camel supports pluggable sorting strategies. This strategy it to use the link:file-language.html[File Language] to configure the sorting. The `sortBy` option is configured as follows: -[source,java] ----------------------------------- +[source] +---- sortBy=group 1;group 2;group 3;... ----------------------------------- +---- Where each group is separated with semi colon. In the simple situations you just use one group, so a simple example could be: -[source,java] ----------------- +[source] +---- sortBy=file:name ----------------- +---- This will sort by file name, you can reverse the order by prefixing `reverse:` to the group, so the sorting is now Z..A: -[source,java] ------------------------- +[source] +---- sortBy=reverse:file:name ------------------------- +---- As we have the full power of link:file-language.html[File Language] we can use some of the other parameters, so if we want to sort by file size we do: -[source,java] ------------------- +[source] +---- sortBy=file:length ------------------- +---- You can configure to ignore the case, using `ignoreCase:` for string comparison, so if you want to use file name sorting but to ignore the case then we do: -[source,java] ---------------------------- +[source] +---- sortBy=ignoreCase:file:name ---------------------------- +---- You can combine ignore case and reverse, however reverse must be specified first: -[source,java] ------------------------------------ +[source] +---- sortBy=reverse:ignoreCase:file:name ------------------------------------ +---- In the sample below we want to sort by last modified file, so we do: -[source,java] --------------------- +[source] +---- sortBy=file:modified --------------------- +---- And then we want to group by name as a 2nd option so files with same modifcation is sorted by name: -[source,java] ------------------------------- +[source] +---- sortBy=file:modified;file:name ------------------------------- +---- Now there is an issue here, can you spot it? Well the modified timestamp of the file is too fine as it will be in milliseconds, but what if we @@ -1043,18 +1032,18 @@ want to sort by date only and then subgroup by name? + Language] we can use its date command that supports patterns. So this can be solved as: -[source,java] ------------------------------------ +[source] +---- sortBy=date:file:yyyyMMdd;file:name ------------------------------------ +---- Yeah, that is pretty powerful, oh by the way you can also use reverse per group, so we could reverse the file names: -[source,java] -------------------------------------------- +[source] +---- sortBy=date:file:yyyyMMdd;reverse:file:name -------------------------------------------- +---- === Using GenericFileProcessStrategy @@ -1090,59 +1079,7 @@ directories, to avoid traversing down unwanted directories. For example to skip any directories which starts with `"skip"` in the name, can be implemented as follows: -=== How to use the Camel error handler to deal with exceptions triggered outside the routing engine - -The file and ftp consumers, will by default try to pickup files. Only if -that is successful then a Camel link:exchange.html[Exchange] can be -created and passed in the Camel routing engine. + - When the link:exchange.html[Exchange] is processed by the routing -engine, then the Camel link:error-handling-in-camel.html[Error Handling] -takes over (eg the onException / errorHandler in the routes). + - However outside the scope of the routing engine, any exceptions -handling is component specific. Camel offers a -`org.apache.camel.spi.ExceptionHandler` that allows components + - to use that as a pluggable hook for end users to use their own -implementation. Camel offers a default `LoggingExceptionHandler` that -will log the exception at ERROR/WARN level. + - For the file and ftp components this would be the case. However if you -want to bridge the `ExceptionHandler` so it uses the Camel -link:error-handling-in-camel.html[Error Handling], then + - you need to implement a custom `ExceptionHandler` that will handle the -exception by creating a Camel link:exchange.html[Exchange] and send it -to the routing engine; then the error handling of the routing engine can -get triggered. - -Here is such an example based upon an unit test. - -First we have a custom `ExceptionHandler` where you can see we deal with -the exception by sending it to a Camel link:endpoint.html[Endpoint] -named "direct:file-error": - -*MyExceptionHandler* - -Then we have a Camel route that uses the Camel routing error handler, -which is the `onException` where we handle any IOException being -thrown. + - We then send the message to the same "direct:file-error" endpoint, -where we handle it by transforming it to a message, and then being sent -to a link:mock.html[Mock] endpoint. + - This is just for testing purpose. You can handle the exception in any -custom way you want, such as using a link:bean.html[Bean] or sending an -email etc. - -Notice how we configure our custom `MyExceptionHandler` by using the -`consumer.exceptionHandler` option to refer to `#myExceptionHandler` -which is a id of the bean registered in the -link:registry.html[Registry]. If using Spring XML or OSGi Blueprint, -then that would be a <bean id="myExceptionHandler" -class="com.foo.MyExceptionHandler"/>: - -*Camel route with routing engine error handling* - -The source code for this example can be seen -https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java[here] - -#=== Using consumer.bridgeErrorHandler +=== Using consumer.bridgeErrorHandler *Available as of Camel 2.10* @@ -1150,14 +1087,26 @@ If you want to use the Camel link:error-handler.html[Error Handler] to deal with any exception occurring in the file consumer, then you can enable the `consumer.bridgeErrorHandler` option as shown below: -*Using consumer.bridgeErrorHandler* +[source,java] +---- +// to handle any IOException being thrown +onException(IOException.class) + .handled(true) + .log("IOException occurred due: ${exception.message}") + .transform().simple("Error ${exception.message}") + .to("mock:error"); + +// this is the file route that pickup files, notice how we bridge the consumer to use the Camel routing error handler +// the exclusiveReadLockStrategy is only configured because this is from an unit test, so we use that to simulate exceptions +from("file:target/nospace?consumer.bridgeErrorHandler=true") + .convertBodyTo(String.class) + .to("mock:result"); +---- So all you have to do is to enable this option, and the error handler in -the route will take it from there. [Info] - -*Important when using -consumer.bridgeErrorHandler* +the route will take it from there. +IMPORTANT: *Important when using consumer.bridgeErrorHandler* When using consumer.bridgeErrorHandler, then link:intercept.html[interceptors], link:oncompletion.html[OnCompletion]s does *not* apply. The link:exchange.html[Exchange] is processed directly @@ -1171,11 +1120,6 @@ problems. === See Also -* link:configuring-camel.html[Configuring Camel] -* link:component.html[Component] -* link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] - * link:file-language.html[File Language] * link:ftp2.html[FTP] * link:polling-consumer.html[Polling Consumer] http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/file-language.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/file-language.adoc b/camel-core/src/main/docs/file-language.adoc index 9bc0591..9dbf989 100644 --- a/camel-core/src/main/docs/file-language.adoc +++ b/camel-core/src/main/docs/file-language.adoc @@ -48,7 +48,7 @@ link:file2.html[File] component supports all of them. [width="100%",cols="10%,10%,10%,10%,10%,25%,25%",options="header",] -|======================================================================= +|=== |Expression |Type |File Consumer |File Producer |FTP Consumer |FTP Producer |Description |file:name |String |yes |no |yes |no |refers to the file name (is relative to the starting directory, see note @@ -98,11 +98,11 @@ an *extension* to the link:simple.html[Simple] language. Additional command is: *file* (consumers only) for the last modified timestamp of the file. Notice: all the commands from the link:simple.html[Simple] language can also be used. -|======================================================================= +|=== === File token example -#=== Relative paths +==== Relative paths We have a `java.io.File` handle for the file `hello.txt` in the following *relative* directory: `.\filelanguage\test`. And we configure @@ -110,7 +110,7 @@ our endpoint to use this starting directory `.\filelanguage`. The file tokens will return as: [width="100%",cols="50%,50%",options="header",] -|======================================================================= +|=== |Expression |Returns |file:name |test\hello.txt @@ -132,9 +132,9 @@ tokens will return as: |file:absolute |false |file:absolute.path |\workspace\camel\camel-core\target\filelanguage\test\hello.txt -|======================================================================= +|=== -#=== Absolute paths +==== Absolute paths We have a `java.io.File` handle for the file `hello.txt` in the following *absolute* directory: @@ -144,7 +144,7 @@ out endpoint to use the absolute starting directory return as: [width="100%",cols="50%,50%",options="header",] -|======================================================================= +|=== |Expression |Returns |file:name |test\hello.txt @@ -166,67 +166,67 @@ return as: |file:absolute |true |file:absolute.path |\workspace\camel\camel-core\target\filelanguage\test\hello.txt -|======================================================================= +|=== === Samples You can enter a fixed link:constant.html[Constant] expression such as `myfile.txt`: -[source,java] ---------------------- +[source] +---- fileName="myfile.txt" ---------------------- +---- Lets assume we use the file consumer to read files and want to move the read files to backup folder with the current date as a sub folder. This can be archieved using an expression like: -[source,java] -------------------------------------------------------------- +[source] +---- fileName="backup/${date:now:yyyyMMdd}/${file:name.noext}.bak" -------------------------------------------------------------- +---- relative folder names are also supported so suppose the backup folder should be a sibling folder then you can append .. as: -[source,java] ----------------------------------------------------------------- +[source] +---- fileName="../backup/${date:now:yyyyMMdd}/${file:name.noext}.bak" ----------------------------------------------------------------- +---- As this is an extension to the link:simple.html[Simple] language we have access to all the goodies from this language also, so in this use case we want to use the in.header.type as a parameter in the dynamic expression: -[source,java] -------------------------------------------------------------------------------------------------- +[source] +---- fileName="../backup/${date:now:yyyyMMdd}/type-${in.header.type}/backup-of-${file:name.noext}.bak" -------------------------------------------------------------------------------------------------- +---- If you have a custom Date you want to use in the expression then Camel supports retrieving dates from the message header. -[source,java] ----------------------------------------------------------------------------------------- +[source] +---- fileName="orders/order-${in.header.customerId}-${date:in.header.orderDate:yyyyMMdd}.xml" ----------------------------------------------------------------------------------------- +---- And finally we can also use a bean expression to invoke a POJO class that generates some String output (or convertible to String) to be used: -[source,java] ------------------------------------------------------------- +[source] +---- fileName="uniquefile-${bean:myguidgenerator.generateid}.txt" ------------------------------------------------------------- +---- And of course all this can be combined in one expression where you can use the link:file-language.html[File Language], link:simple.html[Simple] and the link:bean.html[Bean] language in one combined expression. This is pretty powerful for those common file path patterns. -=== Using Spring PropertyPlaceholderConfigurer together with the link:file2.html[File] component +=== Using Spring PropertyPlaceholderConfigurer together with the File component In Camel you can use the link:file-language.html[File Language] directly from the link:simple.html[Simple] language which makes a @@ -234,22 +234,22 @@ link:content-based-router.html[Content Based Router] easier to do in Spring XML, where we can route based on file extensions as shown below: [source,xml] ----------------------------------------------------------------- - <from uri="file://input/orders"/> - <choice> - <when> - <simple>${file:ext} == 'txt'</simple> - <to uri="bean:orderService?method=handleTextFiles"/> - </when> - <when> - <simple>${file:ext} == 'xml'</simple> - <to uri="bean:orderService?method=handleXmlFiles"/> - </when> - <otherwise> - <to uri="bean:orderService?method=handleOtherFiles"/> - </otherwise> - </choice> ----------------------------------------------------------------- +---- +<from uri="file://input/orders"/> + <choice> + <when> + <simple>${file:ext} == 'txt'</simple> + <to uri="bean:orderService?method=handleTextFiles"/> + </when> + <when> + <simple>${file:ext} == 'xml'</simple> + <to uri="bean:orderService?method=handleXmlFiles"/> + </when> + <otherwise> + <to uri="bean:orderService?method=handleOtherFiles"/> + </otherwise> + </choice> +---- If you use the `fileName` option on the link:file2.html[File] endpoint to set a dynamic filename using the link:file-language.html[File @@ -259,8 +259,8 @@ clashing with Springs `PropertyPlaceholderConfigurer`. *bundle-context.xml* -[source,java] --------------------------------------------------------------------------------------------------------------- +[source,xml] +---- <bean id="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:bundle-context.cfg" /> </bean> @@ -269,15 +269,15 @@ clashing with Springs `PropertyPlaceholderConfigurer`. <property name="fromEndpoint" value="${fromEndpoint}" /> <property name="toEndpoint" value="${toEndpoint}" /> </bean> --------------------------------------------------------------------------------------------------------------- +---- *bundle-context.cfg* -[source,java] ----------------------------------------------------------------------------- +[source] +---- fromEndpoint=activemq:queue:test toEndpoint=file://fileRoute/out?fileName=test-$simple{date:now:yyyyMMdd}.txt ----------------------------------------------------------------------------- +---- Notice how we use the $simple\{ } syntax in the `toEndpoint` above. + If you don't do this, there is a clash and Spring will throw an http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/gzip-dataformat.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/gzip-dataformat.adoc b/camel-core/src/main/docs/gzip-dataformat.adoc index 6eb255c..1854726 100644 --- a/camel-core/src/main/docs/gzip-dataformat.adoc +++ b/camel-core/src/main/docs/gzip-dataformat.adoc @@ -33,9 +33,9 @@ payload employing gzip compression format and send it an ActiveMQ queue called MY_QUEUE. [source,java] --------------------------------------------------------------------- +---- from("direct:start").marshal().gzip().to("activemq:queue:MY_QUEUE"); --------------------------------------------------------------------- +---- === Unmarshal @@ -44,9 +44,9 @@ called MY_QUEUE to its original format, and forward it for processing to the `UnGZippedMessageProcessor`. [source,java] ---------------------------------------------------------------------------------------------- +---- from("activemq:queue:MY_QUEUE").unmarshal().gzip().process(new UnGZippedMessageProcessor()); ---------------------------------------------------------------------------------------------- +---- === Dependencies http://git-wip-us.apache.org/repos/asf/camel/blob/a5d3b750/camel-core/src/main/docs/header-language.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/header-language.adoc b/camel-core/src/main/docs/header-language.adoc index 728f2f9..a26bef3 100644 --- a/camel-core/src/main/docs/header-language.adoc +++ b/camel-core/src/main/docs/header-language.adoc @@ -34,9 +34,9 @@ fullest (i.e. avoid using parameters but using stacked operations, notice that header is not a parameter but a stacked method call) [source,java] ------------------------------------------------------- - from("direct:a").recipientList().header("myHeader"); ------------------------------------------------------- +---- +from("direct:a").recipientList().header("myHeader"); +---- === Dependencies