This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new d50bbbb Regen d50bbbb is described below commit d50bbbb6cd37383c7d838941cc2990ca05e1fd35 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Apr 18 07:04:35 2019 +0200 Regen --- .../modules/ROOT/pages/cxfrs-component.adoc | 7 ++- .../modules/ROOT/pages/dns-component.adoc | 12 ++-- .../modules/ROOT/pages/file-component.adoc | 17 ++++-- .../modules/ROOT/pages/influxdb-component.adoc | 13 ----- .../modules/ROOT/pages/jacksonxml-dataformat.adoc | 2 +- .../modules/ROOT/pages/log-component.adoc | 6 +- .../modules/ROOT/pages/mail-component.adoc | 65 +++++++++++++--------- .../modules/ROOT/pages/mina2-component.adoc | 4 +- .../modules/ROOT/pages/netty4-http-component.adoc | 56 +++++++++++-------- .../modules/ROOT/pages/quartz2-component.adoc | 11 ++-- .../modules/ROOT/pages/spark-rest-component.adoc | 2 +- .../modules/ROOT/pages/spring-batch-component.adoc | 20 +++---- .../modules/ROOT/pages/spring-redis-component.adoc | 6 +- .../modules/ROOT/pages/spring-ws-component.adoc | 8 ++- docs/components/modules/ROOT/pages/spring.adoc | 40 +++++++------ .../modules/ROOT/pages/sql-component.adoc | 52 +++++++++-------- .../modules/ROOT/pages/tarfile-dataformat.adoc | 13 ++--- .../modules/ROOT/pages/vertx-component.adoc | 2 +- .../ROOT/pages/yaml-snakeyaml-dataformat.adoc | 8 +-- 19 files changed, 194 insertions(+), 150 deletions(-) diff --git a/docs/components/modules/ROOT/pages/cxfrs-component.adoc b/docs/components/modules/ROOT/pages/cxfrs-component.adoc index 12de0c6..9e5b852 100644 --- a/docs/components/modules/ROOT/pages/cxfrs-component.adoc +++ b/docs/components/modules/ROOT/pages/cxfrs-component.adoc @@ -369,12 +369,15 @@ protected RouteBuilder createRouteBuilder() throws Exception { And the corresponding resource class used to configure the endpoint... -INFO:*Note about resource classes* +[NOTE] +==== +*Note about resource classes* -By default, JAX-RS resource classes are *only*used to configure JAX-RS +By default, JAX-RS resource classes are *only* used to configure JAX-RS properties. Methods will *not* be executed during routing of messages to the endpoint. Instead, it is the responsibility of the route to do all processing. +==== Note that starting from Camel 2.15 it is also sufficient to provide an interface only as opposed to a no-op service implementation class for diff --git a/docs/components/modules/ROOT/pages/dns-component.adoc b/docs/components/modules/ROOT/pages/dns-component.adoc index 2a47374..902a748 100644 --- a/docs/components/modules/ROOT/pages/dns-component.adoc +++ b/docs/components/modules/ROOT/pages/dns-component.adoc @@ -5,19 +5,23 @@ This is an additional component for Camel to run DNS queries, using DNSJava. The component is a thin layer on top of -http://www.xbill.org/dnsjava/[DNSJava]. + - The component offers the following operations: +http://www.xbill.org/dnsjava/[DNSJava]. +The component offers the following operations: * ip, to resolve a domain by its ip * lookup, to lookup information about the domain * dig, to run DNS queries -INFO:*Requires SUN JVM* -The DNSJava library requires running on the SUN JVM. + +[NOTE] +==== +*Requires SUN JVM* + +The DNSJava library requires running on the SUN JVM. If you use Apache ServiceMix or Apache Karaf, you'll need to adjust the `etc/jre.properties` file, to add `sun.net.spi.nameservice` to the list of Java platform packages exported. The server will need restarting before this change takes effect. +==== Maven users will need to add the following dependency to their `pom.xml` for this component: diff --git a/docs/components/modules/ROOT/pages/file-component.adoc b/docs/components/modules/ROOT/pages/file-component.adoc index 192aeb1..432b850 100644 --- a/docs/components/modules/ROOT/pages/file-component.adoc +++ b/docs/components/modules/ROOT/pages/file-component.adoc @@ -29,22 +29,26 @@ You can append query options to the URI in the following format, *Only directories* Camel supports only endpoints configured with a starting directory. So -the *directoryName* must be a directory. + +the *directoryName* must be a directory. If you want to consume a single file only, you can use the *fileName* -option, e.g. by setting `fileName=thefilename`. + +option, e.g. by setting `fileName=thefilename`. Also, the starting directory must not contain dynamic expressions with -$\{ } placeholders. Again use the `fileName` option to specify the +`${ }` 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 consuming it. Therefore you have to do you own investigation what suites your environment. To help with this Camel provides different `readLock` options and `doneFileName` option that you can use. See also the section -_Consuming files from folders where others drop files directly_. +<<File2-Consumingfilesfromfolderswhereothersdropfilesdirectly,Consuming files from folders where others drop files directly>>. +==== === URI Options @@ -518,6 +522,7 @@ string-based <<file-language,File Language>> expression in the `CamelFileName` header. See the <<file-language,File Language>> for syntax and samples. +[[File2-Consumingfilesfromfolderswhereothersdropfilesdirectly]] === Consuming files from folders where others drop files directly Beware if you consume files from a folder where other applications write diff --git a/docs/components/modules/ROOT/pages/influxdb-component.adoc b/docs/components/modules/ROOT/pages/influxdb-component.adoc index 08ff714..98abaa8 100644 --- a/docs/components/modules/ROOT/pages/influxdb-component.adoc +++ b/docs/components/modules/ROOT/pages/influxdb-component.adoc @@ -110,21 +110,8 @@ The component supports 2 options, which are listed below. // spring-boot-auto-configure options: END - - - -### Message Headers - -[width="100%",cols="10%,10%,10%,10%,60%",options="header",] -|======================================================================= -|Name |Default Value |Type |Context |Description - -| | | | | -|======================================================================= - ### Example - Below is an example route that stores a point into the db (taking the db name from the URI) specific key: diff --git a/docs/components/modules/ROOT/pages/jacksonxml-dataformat.adoc b/docs/components/modules/ROOT/pages/jacksonxml-dataformat.adoc index b0b2d93..40c247d 100644 --- a/docs/components/modules/ROOT/pages/jacksonxml-dataformat.adoc +++ b/docs/components/modules/ROOT/pages/jacksonxml-dataformat.adoc @@ -9,7 +9,7 @@ https://github.com/FasterXML/jackson-dataformat-xml[XMLMapper extension] to unmarshal an XML payload into Java objects or to marshal Java objects into an XML payload. -INFO:If you are familiar with Jackson, this XML data format behaves in the +TIP: If you are familiar with Jackson, this XML data format behaves in the same way as its JSON counterpart, and thus can be used with classes annotated for JSON serialization/deserialization. diff --git a/docs/components/modules/ROOT/pages/log-component.adoc b/docs/components/modules/ROOT/pages/log-component.adoc index 3a69591..0c56baa 100644 --- a/docs/components/modules/ROOT/pages/log-component.adoc +++ b/docs/components/modules/ROOT/pages/log-component.adoc @@ -24,7 +24,10 @@ Where *loggingCategory* is the name of the logging category to use. You can append query options to the URI in the following format, `?option=value&option=value&...` -INFO:*Using Logger instance from the Registry* +[NOTE] +==== +*Using Logger instance from the Registry* + As of *Camel 2.12.4/2.13.1*, if there's single instance of `org.slf4j.Logger` found in the Registry, the *loggingCategory* is no longer used to create logger instance. The registered instance is used @@ -32,6 +35,7 @@ instead. Also it is possible to reference particular `Logger` instance using `?logger=#myLogger` URI parameter. Eventually, if there's no registered and URI `logger` parameter, the logger instance is created using *loggingCategory*. +==== For example, a log endpoint typically specifies the logging level using the `level` option, as follows: diff --git a/docs/components/modules/ROOT/pages/mail-component.adoc b/docs/components/modules/ROOT/pages/mail-component.adoc index 4b980e0..8b26daa 100644 --- a/docs/components/modules/ROOT/pages/mail-component.adoc +++ b/docs/components/modules/ROOT/pages/mail-component.adoc @@ -19,7 +19,9 @@ for this component: </dependency> ------------------------------------------------------------ -WARNING: *Geronimo mail .jar* +[WARNING] +==== +*Geronimo mail .jar* We have discovered that the geronimo mail `.jar` (v1.6) has a bug when polling mails with attachments. It cannot correctly identify the @@ -30,24 +32,33 @@ it, the `Content-Type` is resolved as `text/plain` and not as enables you to provide your own implementation and fix this bug by returning the correct Mime type based on the file name. So if the file name ends with `jpeg/jpg`, you can return `image/jpeg`. +==== You can set your custom resolver on the `MailComponent` instance or on the `MailEndpoint` instance. -TIP: *POP3 or IMAP* +[TIP] +==== +*POP3 or IMAP* + POP3 has some limitations and end users are encouraged to use IMAP if possible. +==== + +[NOTE] +==== +*Using mock-mail for testing* -INFO: *Using mock-mail for testing* You can use a mock framework for unit testing, which allows you to test without the need for a real mail server. However you should remember to not include the mock-mail when you go into production or other environments where you need to send mails to a real mail server. Just the presence of the mock-javamail.jar on the classpath means that it will kick in and avoid sending the mails. +==== -### URI format +=== URI format Mail endpoints can have one of the following URI formats (for the protocols, SMTP, POP3, or IMAP, respectively): @@ -74,7 +85,7 @@ You can append query options to the URI in the following format, `?option=value&option=value&...` -### [[Mail-Component-Options]] +=== [[Mail-Component-Options]] // component options: START @@ -95,7 +106,7 @@ The Mail component supports 5 options, which are listed below. -### [[Mail-Endpoint-Options]] +=== [[Mail-Endpoint-Options]] // endpoint options: START @@ -267,7 +278,7 @@ The component supports 49 options, which are listed below. -#### Sample endpoints +==== Sample endpoints Typically, you specify a URI with login credentials as follows (taking SMTP as an example): @@ -292,7 +303,7 @@ For example: smtp://mycompany.mailserver:30?password=tiger&username=scott ------------------------------------------------------------ -### Components +=== Components - IMAP - IMAPs @@ -301,7 +312,7 @@ smtp://mycompany.mailserver:30?password=tiger&username=scott - SMTP - SMTPs -#### Default ports +==== Default ports Default port numbers are supported. If the port number is omitted, Camel determines the port number to use based on the protocol. @@ -317,7 +328,7 @@ determines the port number to use based on the protocol. |`IMAPS` |`993` |======================================================================= -### SSL support +=== SSL support The underlying mail framework is responsible for providing SSL support. You may either configure SSL/TLS support by completely specifying the @@ -325,7 +336,7 @@ necessary Java Mail API configuration options, or you may provide a configured SSLContextParameters through the component or endpoint configuration. -#### Using the JSSE Configuration Utility +==== Using the JSSE Configuration Utility As of *Camel 2.10*, the mail component supports SSL/TLS configuration through the link:camel-configuration-utilities.html[Camel JSSE @@ -368,7 +379,7 @@ Spring DSL based configuration of endpoint <to uri="smtps://smtp.google.com?username=u...@gmail.com&password=password&sslContextParameters=#sslContextParameters"/>... --------------------------------------------------------------------------------------------------------------------------- -#### Configuring JavaMail Directly +==== Configuring JavaMail Directly Camel uses SUN JavaMail, which only trusts certificates issued by well known Certificate Authorities (the default JVM trust configuration). If @@ -376,7 +387,7 @@ you issue your own certificates, you have to import the CA certificates into the JVM's Java trust/key store files, override the default JVM trust/key store files (see `SSLNOTES.txt` in JavaMail for details). -### Mail Message Content +=== Mail Message Content Camel uses the message exchange's IN body as the http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage] @@ -399,7 +410,7 @@ server, you should be able to get the message id of the http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMessage.html[MimeMessage] with the key `CamelMailMessageId` from the Camel message header. -### Headers take precedence over pre-configured recipients +=== Headers take precedence over pre-configured recipients The recipients specified in the message headers always take precedence over recipients pre-configured in the endpoint URI. The idea is that if @@ -425,7 +436,7 @@ pre-configured settings. template.sendBodyAndHeaders("smtp://admin@localhost?to=i...@mycompany.com", "Hello World", headers); ------------------------------------------------------------------------------------------------------------ -### Multiple recipients for easier configuration +=== Multiple recipients for easier configuration It is possible to set multiple recipients using a comma-separated or a semicolon-separated list. This applies both to header settings and to @@ -439,7 +450,7 @@ settings in an endpoint URI. For example: The preceding example uses a semicolon, `;`, as the separator character. -### Setting sender name and email +=== Setting sender name and email You can specify recipients in the format, `name <email>`, to include both the name and the email address of the recipient. @@ -455,7 +466,7 @@ map.put("From", "James Strachan <jstrac...@apache.org>"); map.put("Subject", "Camel is cool"); --------------------------------------------------------- -### JavaMail API (ex SUN JavaMail) +=== JavaMail API (ex SUN JavaMail) https://java.net/projects/javamail/pages/Home[JavaMail API] is used under the hood for consuming and producing mails. + @@ -471,7 +482,7 @@ IMAP API] https://javamail.java.net/nonav/docs/api/javax/mail/Flags.html[MAIL Flags] -### Samples +=== Samples We start with a simple route that sends the messages received from a JMS queue as emails. The email account is the `admin` account on @@ -495,23 +506,27 @@ from("imap://ad...@mymailserver.com In this sample we want to send a mail to multiple recipients: -### Sending mail with attachment sample +=== Sending mail with attachment sample + +[WARNING] +==== +*Attachments are not support by all Camel components* -WARNING: *Attachments are not support by all Camel components* The _Attachments API_ is based on the Java Activation Framework and is generally only used by the Mail API. Since many of the other Camel components do not support attachments, the attachments could potentially be lost as they propagate along the route. The rule of thumb, therefore, is to add attachments just before sending a message to the mail endpoint. +==== The mail component supports attachments. In the sample below, we send a mail message containing a plain text message with a logo file attachment. -### SSL sample +=== SSL sample In this sample, we want to poll our Google mail inbox for mails. To download mail onto a local mail client, Google mail requires you to @@ -540,7 +555,7 @@ progress in the logs: 2008-05-08 06:32:12,187 INFO newmail - Exchange[MailMessage: messageNumber=[332], from=[James Bond <0...@mi5.co.uk>], to=your_usern...@gmail.com], subject=[... ------------------------------------------------------------------------------------------------------------------------------------------------------------------ -### Consuming mails with attachment sample +=== Consuming mails with attachment sample In this sample we poll a mailbox and store all attachments from the mails as files. First, we define a route to poll the mailbox. As this @@ -585,7 +600,7 @@ As you can see the API to handle attachments is a bit clunky but it's there so you can get the `javax.activation.DataHandler` so you can handle the attachments using standard API. -### How to split a mail message with attachments +=== How to split a mail message with attachments In this example we consume mail messages which may have a number of attachments. What we want to do is to use the @@ -630,7 +645,7 @@ SplitAttachmentsExpression split = SplitAttachmentsExpression(true); And then use the expression with the splitter eip. -### Using custom SearchTerm +=== Using custom SearchTerm *Available as of Camel 2.11* @@ -718,7 +733,7 @@ builder.unseen().body(Op.not, "Spam").subject(Op.not, "Spam") SearchTerm term = builder.build(); -------------------------------------------------------------- -### See Also +=== See Also * Configuring Camel * Component diff --git a/docs/components/modules/ROOT/pages/mina2-component.adoc b/docs/components/modules/ROOT/pages/mina2-component.adoc index d386706..e76cf55 100644 --- a/docs/components/modules/ROOT/pages/mina2-component.adoc +++ b/docs/components/modules/ROOT/pages/mina2-component.adoc @@ -7,9 +7,9 @@ The *mina2:* component is a transport for working with http://mina.apache.org/[Apache MINA 2.x] TIP: Favor using <<netty-component,Netty>> as Netty is a much more active -maintained and popular project than Apache Mina currently is +maintained and popular project than Apache Mina currently is. -INFO: Be careful with sync=false on consumer endpoints. Since camel-mina2 all +WARNING: Be careful with `sync=false` on consumer endpoints. Since camel-mina2 all consumer exchanges are InOut. This is different to camel-mina. Maven users will need to add the following dependency to their `pom.xml` diff --git a/docs/components/modules/ROOT/pages/netty4-http-component.adoc b/docs/components/modules/ROOT/pages/netty4-http-component.adoc index dbafa93..7dc8ee9 100644 --- a/docs/components/modules/ROOT/pages/netty4-http-component.adoc +++ b/docs/components/modules/ROOT/pages/netty4-http-component.adoc @@ -9,7 +9,11 @@ component to facilitiate HTTP transport with <<netty4-component,Netty4>>. This camel component supports both producer and consumer endpoints. -INFO: *Stream*. Netty is stream based, which means the input it receives is submitted to +[NOTE] +==== +*Stream* + +Netty is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream *once*. If you find a situation where the message body appears to be empty or you need to access the data multiple times (eg: doing multicasting, or @@ -19,6 +23,7 @@ Notice Netty4 HTTP reads the entire stream into memory using `io.netty.handler.codec.http.HttpObjectAggregator` to build the entire full http message. But the resulting message is still a stream based message which is readable once. +==== Maven users will need to add the following dependency to their `pom.xml` for this component: @@ -33,7 +38,7 @@ for this component: </dependency> ------------------------------------------------------------ -### URI format +=== URI format The URI scheme for a netty component is as follows @@ -46,31 +51,38 @@ You can append query options to the URI in the following format, `?option=value&option=value&...` -INFO: *Query parameters vs endpoint options*. +[NOTE] +==== +*Query parameters vs endpoint options* + You may be wondering how Camel recognizes URI query parameters and -endpoint options. For example you might create endpoint URI as follows - +endpoint options. For example you might create endpoint URI as follows: `netty4-http:http//example.com?myParam=myValue&compression=true` . In this example `myParam` is the HTTP parameter, while `compression` is the Camel endpoint option. The strategy used by Camel in such situations is to resolve available endpoint options and remove them from the URI. It means that for the discussed example, the HTTP request sent by Netty -HTTP producer to the endpoint will look as follows -- `http//example.com?myParam=myValue` , because `compression` endpoint +HTTP producer to the endpoint will look as follows: +`http//example.com?myParam=myValue`, because `compression` endpoint option will be resolved and removed from the target URL. Keep also in mind that you cannot specify endpoint options using dynamic headers (like `CamelHttpQuery`). Endpoint options can be specified only at the endpoint URI definition level (like `to` or `from` DSL elements). +==== -### HTTP Options +=== HTTP Options +[IMPORTANT] +==== +*A lot more options* -INFO: *A lot more options*. *Important:* This component inherits all the options from -<<netty4-component,Netty4>>. So make sure to look at -the <<netty4-component,Netty4>> documentation as well. + - Notice that some options from <<netty4-component,Netty4>> is not +This component inherits all the options from +<<netty4-component,Netty4>>, so make sure to look at +the <<netty4-component,Netty4>> documentation as well. +Notice that some options from <<netty4-component,Netty4>> is not applicable when using this Netty4 HTTP component, such as options related to UDP transport. - +==== @@ -277,7 +289,7 @@ The component supports 32 options, which are listed below. -### Message Headers +=== Message Headers The following headers can be used on the producer to control the HTTP request. @@ -343,7 +355,7 @@ with the value `Basic`. `text/plain; charset="UTF-8"`. |======================================================================= -### Access to Netty types +=== Access to Netty types This component uses the `org.apache.camel.component.netty4.http.NettyHttpMessage` as the message @@ -357,7 +369,7 @@ accessible at all times. io.netty.handler.codec.http.HttpRequest request = exchange.getIn(NettyHttpMessage.class).getHttpRequest(); ---------------------------------------------------------------------------------------------------------- -### Examples +=== Examples In the route below we use Netty4 HTTP as a HTTP server, which returns back a hardcoded "Bye World" message. @@ -379,7 +391,7 @@ ProducerTemplate as shown below: And we get back "Bye World" as the output. -### How do I let Netty match wildcards +=== How do I let Netty match wildcards By default Netty4 HTTP will only match on exact uri's. But you can instruct Netty to match prefixes. For example @@ -410,7 +422,7 @@ To match *any* endpoint you can do: from("netty4-http:http://0.0.0.0:8123?matchOnUriPrefix=true").to("mock:foo"); ----------------------------------------------------------------------------- -### Using multiple routes with same port +=== Using multiple routes with same port In the same CamelContext you can have multiple routes from Netty4 HTTP that shares the same port (eg a @@ -463,7 +475,7 @@ from("netty4-http:http://0.0.0.0:{{port}}/bar?ssl=true") .transform().constant("Bye Camel"); -------------------------------------------------------------------------------------- -#### Reusing same server bootstrap configuration with multiple routes +==== Reusing same server bootstrap configuration with multiple routes By configuring the common server bootstrap option in an single instance of a @@ -500,12 +512,12 @@ And in the routes you refer to this option as shown below </route> ---------------------------------------------------------------------------------------------------------- -#### Reusing same server bootstrap configuration with multiple routes across multiple bundles in OSGi container +==== Reusing same server bootstrap configuration with multiple routes across multiple bundles in OSGi container See the Netty HTTP Server Example for more details and example how to do that. -### Using HTTP Basic Authentication +=== Using HTTP Basic Authentication The Netty HTTP consumer supports HTTP basic authentication by specifying the security realm name to use, as shown below @@ -527,7 +539,7 @@ End user of Apache Karaf / ServiceMix has a karaf realm out of the box, and hence why the example above would work out of the box in these containers. -#### Specifying ACL on web resources +==== Specifying ACL on web resources The `org.apache.camel.component.netty4.http.SecurityConstraint` allows to define constrains on web resources. And the @@ -579,7 +591,7 @@ below: </route> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -### See Also +=== See Also * Configuring Camel * Component diff --git a/docs/components/modules/ROOT/pages/quartz2-component.adoc b/docs/components/modules/ROOT/pages/quartz2-component.adoc index 5eeb489..40ddf4f 100644 --- a/docs/components/modules/ROOT/pages/quartz2-component.adoc +++ b/docs/components/modules/ROOT/pages/quartz2-component.adoc @@ -169,14 +169,17 @@ http://quartz-scheduler.org/api/2.0.0/org/quartz/JobDataMap.html[JobDataMap] is re-persisted after every execution of the job, thus preserving state for the next execution. -INFO: *Running in OSGi and having multiple bundles with quartz -routes* +[NOTE] +==== +*Running in OSGi and having multiple bundles with quartz routes* + If you run in OSGi such as Apache ServiceMix, or Apache Karaf, and have multiple bundles with Camel routes that start from <<quartz2-component,Quartz2>> endpoints, then make sure if you assign an `id` -to the <camelContext> that this id is unique, as this is +to the `<camelContext>` that this id is unique, as this is required by the `QuartzScheduler` in the OSGi container. If you do not -set any `id` on <camelContext> then a unique id is auto assigned, and there is no problem. +set any `id` on `<camelContext>` then a unique id is auto assigned, and there is no problem. +==== === Configuring quartz.properties file diff --git a/docs/components/modules/ROOT/pages/spark-rest-component.adoc b/docs/components/modules/ROOT/pages/spark-rest-component.adoc index c0c9049..c530fbf 100644 --- a/docs/components/modules/ROOT/pages/spark-rest-component.adoc +++ b/docs/components/modules/ROOT/pages/spark-rest-component.adoc @@ -7,7 +7,7 @@ The Spark-rest component allows to define REST endpoints using the http://sparkjava.com/[Spark REST Java library] using the Rest DSL. -INFO: Spark Java requires Java 8 runtime. +NOTE: Spark Java requires Java 8 runtime. Maven users will need to add the following dependency to their pom.xml for this component: diff --git a/docs/components/modules/ROOT/pages/spring-batch-component.adoc b/docs/components/modules/ROOT/pages/spring-batch-component.adoc index 9ab3620..0e0a140 100644 --- a/docs/components/modules/ROOT/pages/spring-batch-component.adoc +++ b/docs/components/modules/ROOT/pages/spring-batch-component.adoc @@ -20,7 +20,7 @@ for this component: </dependency> ------------------------------------------------------------ -### URI format +=== URI format [source,java] ------------------------------ @@ -31,11 +31,11 @@ Where *jobName* represents the name of the Spring Batch job located in the Camel registry. Alternatively if a JobRegistry is provided it will be used to locate the job instead. -WARNING:This component can only be used to define producer endpoints, which +WARNING: This component can only be used to define producer endpoints, which means that you cannot use the Spring Batch component in a `from()` statement. -### Options +=== Options @@ -127,7 +127,7 @@ The component supports 4 options, which are listed below. -### Usage +=== Usage When Spring Batch component receives the message, it triggers the job execution. The job will be executed using the @@ -149,7 +149,7 @@ parameters. `String`, `Long`, `Double` and `java.util.Date` values are copied to the `org.springframework.batch.core.JobParametersBuilder` - other data types are converted to Strings. -### Examples +=== Examples Triggering the Spring Batch job execution: @@ -180,12 +180,12 @@ JobExecution jobExecution = mockEndpoint.getExchanges().get(0).getIn().getBody(J BatchStatus currentJobStatus = jobExecution.getStatus(); --------------------------------------------------------------------------------------------------- -### Support classes +=== Support classes Apart from the Component, Camel Spring Batch provides also support classes, which can be used to hook into Spring Batch infrastructure. -#### CamelItemReader +==== CamelItemReader `CamelItemReader` can be used to read batch data directly from the Camel infrastructure. @@ -209,7 +209,7 @@ JMS queue. </batch:job> ----------------------------------------------------------------------------------------------- -#### CamelItemWriter +==== CamelItemWriter `CamelItemWriter` has similar purpose as `CamelItemReader`, but it is dedicated to write chunk of the processed data. @@ -233,7 +233,7 @@ JMS queue. </batch:job> ----------------------------------------------------------------------------------------------- -#### CamelItemProcessor +==== CamelItemProcessor `CamelItemProcessor` is the implementation of Spring Batch `org.springframework.batch.item.ItemProcessor` interface. The latter @@ -273,7 +273,7 @@ the http://camel.apache.org/simple.html[Simple expression language]. </batch:job> ------------------------------------------------------------------------------------------------------------- -#### CamelJobExecutionListener +==== CamelJobExecutionListener `CamelJobExecutionListener` is the implementation of the `org.springframework.batch.core.JobExecutionListener` interface sending diff --git a/docs/components/modules/ROOT/pages/spring-redis-component.adoc b/docs/components/modules/ROOT/pages/spring-redis-component.adoc index 890c486..c902247 100644 --- a/docs/components/modules/ROOT/pages/spring-redis-component.adoc +++ b/docs/components/modules/ROOT/pages/spring-redis-component.adoc @@ -7,12 +7,12 @@ This component allows sending and receiving messages from https://redis.io/[Redis]. Redis is advanced key-value store where keys can contain strings, hashes, lists, sets and sorted sets. In addition it provides pub/sub functionality for inter-app -communications. + - Camel provides a producer for executing commands, consumer for +communications. +Camel provides a producer for executing commands, consumer for subscribing to pub/sub messages an idempotent repository for filtering out duplicate messages. -INFO:*Prerequisites* +NOTE: *Prerequisites:* In order to use this component, you must have a Redis server running. diff --git a/docs/components/modules/ROOT/pages/spring-ws-component.adoc b/docs/components/modules/ROOT/pages/spring-ws-component.adoc index a817d3a..e5e0a16 100644 --- a/docs/components/modules/ROOT/pages/spring-ws-component.adoc +++ b/docs/components/modules/ROOT/pages/spring-ws-component.adoc @@ -22,7 +22,10 @@ for this component: </dependency> ------------------------------------------------------------ -INFO:*Dependencies* +[NOTE] +==== +*Dependencies* + As of Camel 2.8 this component ships with Spring-WS 2.0.x which (like the rest of Camel) requires Spring 3.0.x. Earlier Camel versions shipped Spring-WS 1.5.9 which is compatible with @@ -32,7 +35,8 @@ module from Spring 2.5.x. In order to run Spring-WS 1.5.9 on Spring 3.0.x you need to exclude the OXM module from Spring 3.0.x as this module is also included in Spring-WS 1.5.9 (see http://stackoverflow.com/questions/3313314/can-spring-ws-1-5-be-used-with-spring-3[this -post]) +post]). +==== ### URI format diff --git a/docs/components/modules/ROOT/pages/spring.adoc b/docs/components/modules/ROOT/pages/spring.adoc index fc2c18d..4405529 100644 --- a/docs/components/modules/ROOT/pages/spring.adoc +++ b/docs/components/modules/ROOT/pages/spring.adoc @@ -1,5 +1,5 @@ [[SpringSupport-SpringSupport]] -## Spring Support +== Spring Support Apache Camel is designed to work nicely with the http://www.springframework.org/[Spring Framework] in a number of ways. @@ -30,7 +30,7 @@ Patterns] and Camel's powerful <<mock-component,Mock>> and * From *Camel 2.15* onwards Camel supports Spring Boot using the `camel-spring-boot` component. -### Using Spring to configure the CamelContext +=== Using Spring to configure the CamelContext You can configure a CamelContext inside any spring.xml using the http://camel.apache.org/maven/current/camel-spring/apidocs/org/apache/camel/spring/CamelContextFactoryBean.html[CamelContextFactoryBean]. @@ -45,7 +45,7 @@ instances. ** Using Java Code ** Using Spring XML -### Adding Camel Schema +=== Adding Camel Schema For Camel 1.x you need to use the following namespace: @@ -79,7 +79,7 @@ So the XML file looks like this: http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> ------------------------------------------------------------------------------------------------------------------ -#### Using camel: namespace +==== Using camel: namespace Or you can refer to camel XSD in the XML declaration: @@ -110,7 +110,7 @@ inline namespace declaration: </camel:camelContext> -------------------------------------------------------------------------------------------- -#### Advanced configuration using Spring +==== Advanced configuration using Spring See more details at link:advanced-configuration-of-camelcontext-using-spring.html[Advanced @@ -123,7 +123,7 @@ RouteBuilder implementations. These can be defined as beans in spring and then referenced in your camel context e.g. -#### Using <package> +==== Using <package> Camel also provides a powerful feature that allows for the automatic discovery and initialization of routes in given packages. This is @@ -141,18 +141,22 @@ separated list of packages that should be searched e.g. ---------------------------------------------------------------- -WARNING:Use caution when specifying the package name as `org.apache.camel` or a +WARNING: Use caution when specifying the package name as `org.apache.camel` or a sub package of this. This causes Camel to search in its own packages for your routes which could cause problems. -INFO:*Will ignore already instantiated classes*. -The <package> and <packageScan> will skip any classes which has already +[NOTE] +==== +*Will ignore already instantiated classes* + +The `<package>` and `<packageScan>` will skip any classes which has already been created by Spring etc. So if you define a route builder as a spring bean tag then that class will be skipped. You can include those beans using `<routeBuilder ref="theBeanId"/>` or the `<contextScan>` feature. +==== -#### Using <packageScan> +==== Using <packageScan> In Camel 2.0 this has been extended to allow selective inclusion and exclusion of discovered route classes using Ant like path matching. In @@ -208,7 +212,7 @@ org.apache.camel.SomeExcludedRoute or org.example.RouteWhichIsExcluded **.??cluded* would match org.simple.IncludedRoute, org.simple.Excluded but not match org.simple.PrecludedRoute -#### Using contextScan +==== Using contextScan *Available as of Camel 2.4* @@ -235,7 +239,7 @@ public class MyRoute extends SpringRouteBuilder { You can also use the ANT style for inclusion and exclusion, as mentioned above in the `<packageScan>` documentation. -### How do I import routes from other XML files +=== How do I import routes from other XML files *Available as of Camel 2.3* @@ -277,7 +281,7 @@ The routes defined in `<routeContext/>` can be reused by multiple runtime each CamelContext will create its own instance of the route based on the definition. -#### Test time exclusion. +==== Test time exclusion. At test time it is often desirable to be able to selectively exclude matching routes from being initalized that are not applicable or useful @@ -330,14 +334,14 @@ protected Class[] excludeRoutes() { } --------------------------------------------------- -### Using Spring XML +=== Using Spring XML You can use Spring 2.0 XML configuration to specify your Xml Configuration for Routes such as in the following http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/routingUsingCamelContextFactory.xml[example]. -### Configuring Components and Endpoints +=== Configuring Components and Endpoints You can configure your Component or Endpoint instances in your Spring @@ -355,7 +359,7 @@ URIs. For more detail see link:how-do-i-configure-endpoints.html[Configuring Endpoints and Components]. -### CamelContextAware +=== CamelContextAware If you want to be injected with the CamelContext in your POJO just implement the @@ -364,13 +368,13 @@ interface]; then when Spring creates your POJO the CamelContext will be injected into your POJO. Also see the link:bean-integration.html[Bean Integration] for further injections. -### Integration Testing +=== Integration Testing To avoid a hung route when testing using Spring Transactions see the note about Spring Integration Testing under Transactional Client. -### See also +=== See also * Spring JMS Tutorial * link:creating-a-new-spring-based-camel-route.html[Creating a new diff --git a/docs/components/modules/ROOT/pages/sql-component.adoc b/docs/components/modules/ROOT/pages/sql-component.adoc index b863a85..535f069 100644 --- a/docs/components/modules/ROOT/pages/sql-component.adoc +++ b/docs/components/modules/ROOT/pages/sql-component.adoc @@ -34,11 +34,11 @@ pattern. See further below. === URI format -WARNING:From Camel 2.11 onwards this component can create both consumer (e.g. +WARNING: From Camel 2.11 onwards this component can create both consumer (e.g. `from()`) and producer endpoints (e.g. `to()`). In previous versions, it could only act as a producer. -INFO:This component can be used as a +TIP: This component can be used as a http://camel.apache.org/transactional-client.html[Transactional Client]. The SQL component uses the following endpoint URI notation: @@ -57,9 +57,10 @@ sql:select * from table where id=:#myId order by name[?options] ---- When using named parameters, Camel will lookup the names from, in the -given precedence: + - 1. from message body if its a `java.util.Map` + - 2. from message headers +given precedence: + +1. from message body if its a `java.util.Map` +2. from message headers If a named parameter cannot be resolved, then an exception is thrown. @@ -332,7 +333,7 @@ message headers (*Available as of Camel 2.12.4, 2.13.1*): === Generated keys -*Available as of Camel 2.12.4, 2.13.1 and 2.14 * +*Available as of Camel 2.12.4, 2.13.1 and 2.14* If you insert data using SQL INSERT, then the RDBMS may support auto generated keys. You can instruct the SQL producer to return the @@ -501,11 +502,14 @@ from("direct:query") *Available as of Camel 2.7*: In this section we will use the JDBC based idempotent repository. -TIP:*Abstract class* +[TIP] +==== +*Abstract class* + From Camel 2.9 onwards there is an abstract class `org.apache.camel.processor.idempotent.jdbc.AbstractJdbcMessageIdRepository` you can extend to build custom JDBC idempotent repository. - +==== First we have to create the database table which will be used by the idempotent repository. For *Camel 2.7*, we use the following schema: @@ -525,11 +529,11 @@ CREATE TABLE CAMEL_MESSAGEPROCESSED ( processorName VARCHAR(255), messageId VARCHAR(100), createdAt TIMESTAMP ) ---- -WARNING:The SQL Server *TIMESTAMP* type is a fixed-length binary-string type. It +WARNING: The SQL Server *TIMESTAMP* type is a fixed-length binary-string type. It does not map to any of the JDBC time types: *DATE*, *TIME*, or *TIMESTAMP*. -Customize the JdbcMessageIdRepository +==== Customize the JdbcMessageIdRepository Starting with *Camel 2.9.1* you have a few options to tune the `org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository` for @@ -570,11 +574,14 @@ the second one is the message id (`String`). *Available as of Camel 2.6* -INFO: *Using JdbcAggregationRepository in Camel 2.6* +[NOTE] +==== +*Using JdbcAggregationRepository in Camel 2.6* In Camel 2.6, the JdbcAggregationRepository is provided in the `camel-jdbc-aggregator` component. From Camel 2.7 onwards, the `JdbcAggregationRepository` is provided in the `camel-sql` component. +==== `JdbcAggregationRepository` is an `AggregationRepository` which on the fly persists the aggregated messages. This ensures that you will not @@ -735,7 +742,7 @@ Here is the declaration for Oracle: <property name="lobHandler" ref="lobHandler"/> </bean> ---- - + ==== Optimistic locking From *Camel 2.12* onwards you can turn on `optimisticLocking` and use @@ -754,16 +761,13 @@ which works as follows: The following check is done: -If the caused exception is an `SQLException` then the SQLState is +* If the caused exception is an `SQLException` then the SQLState is checked if starts with 23. - -If the caused exception is a `DataIntegrityViolationException` - -If the caused exception class name has "ConstraintViolation" in its +* If the caused exception is a `DataIntegrityViolationException` +* If the caused exception class name has "ConstraintViolation" in its name. - -optional checking for FQN class name matches if any class names has been -configured +* Optional checking for FQN class name matches if any class names has been +configured. You can in addition add FQN classnames, and if any of the caused exception (or any nested) equals any of the FQN class names, then its an @@ -773,7 +777,7 @@ Here is an example, where we define 2 extra FQN class names from the JDBC vendor. [source,xml] ------ +---- <bean id="repo" class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository"> <property name="transactionManager" ref="transactionManager"/> @@ -790,15 +794,15 @@ class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository"> </util:set> </property> </bean> ------ +---- === Camel Sql Starter A starter module is available to spring-boot users. When using the starter, the `DataSource` can be directly configured using spring-boot properties. -[source,text] ------ +[source,java] +---- # Example for a mysql datasource spring.datasource.url=jdbc:mysql://localhost/test spring.datasource.username=dbuser diff --git a/docs/components/modules/ROOT/pages/tarfile-dataformat.adoc b/docs/components/modules/ROOT/pages/tarfile-dataformat.adoc index cc42373..33a9a94 100644 --- a/docs/components/modules/ROOT/pages/tarfile-dataformat.adoc +++ b/docs/components/modules/ROOT/pages/tarfile-dataformat.adoc @@ -11,7 +11,7 @@ entry can be unmarshalled (decompressed) to the original file contents. There is also a aggregation strategy that can aggregate multiple messages into a single Tar File. -### TarFile Options +=== TarFile Options // dataformat options: START @@ -58,10 +58,9 @@ The component supports 5 options, which are listed below. | *camel.dataformat.tarfile.using-iterator* | If the tar file has more then one entry, the setting this option to true, allows to work with the splitter EIP, to split the data using an iterator in a streaming mode. | false | Boolean |=== // spring-boot-auto-configure options: END -ND -### Marshal +=== Marshal In this example we marshal a regular text/XML payload to a compressed payload using Tar File compression, and send it to an ActiveMQ queue @@ -102,7 +101,7 @@ from("direct:start").setHeader(Exchange.FILE_NAME, constant("report.txt")).marsh This route would result in a Tar File named "report.txt.tar" in the output directory, containing a single Tar entry named "report.txt". -### Unmarshal +=== Unmarshal In this example we unmarshal a Tar File payload from an ActiveMQ queue called MY_QUEUE to its original format, and forward it for processing to @@ -142,9 +141,9 @@ like this ---------------------------------------------------------------------------------------------------- -### Aggregate +=== Aggregate -INFO:Please note that this aggregation strategy requires eager completion +NOTE: Please note that this aggregation strategy requires eager completion check to work properly. In this example we aggregate all text files found in the input directory @@ -176,7 +175,7 @@ the `CamelFileName` header explicitly in your route: .to("file:output/directory"); ------------------------------------------------------------ -### Dependencies +=== Dependencies To use Tar Files in your camel routes you need to add a dependency on *camel-tarfile* which implements this data format. diff --git a/docs/components/modules/ROOT/pages/vertx-component.adoc b/docs/components/modules/ROOT/pages/vertx-component.adoc index f8117b2..b2325a6 100644 --- a/docs/components/modules/ROOT/pages/vertx-component.adoc +++ b/docs/components/modules/ROOT/pages/vertx-component.adoc @@ -9,7 +9,7 @@ https://vertx.io/docs/vertx-core/java/#event_bus[EventBus]. The vertx https://vertx.io/docs/vertx-core/java/#event_bus[EventBus] sends and receives JSON events. -INFO:From *Camel 2.16* onwards vertx 3 is in use which requires Java 1.8 at +NOTE: From *Camel 2.16* onwards vertx 3 is in use which requires Java 1.8 at runtime. Maven users will need to add the following dependency to their `pom.xml` diff --git a/docs/components/modules/ROOT/pages/yaml-snakeyaml-dataformat.adoc b/docs/components/modules/ROOT/pages/yaml-snakeyaml-dataformat.adoc index b0cd716..5c905ac 100644 --- a/docs/components/modules/ROOT/pages/yaml-snakeyaml-dataformat.adoc +++ b/docs/components/modules/ROOT/pages/yaml-snakeyaml-dataformat.adoc @@ -15,7 +15,7 @@ Every library requires adding the special camel component (see "Dependency..." paragraphs further down). By default Camel uses the SnakeYAML library. -### YAML Options +=== YAML Options // dataformat options: START The YAML SnakeYAML dataformat supports 11 options, which are listed below. @@ -78,7 +78,7 @@ The component supports 12 options, which are listed below. WARNING: SnakeYAML can load any class from YAML definition which may lead to security breach so by default, SnakeYAML DataForma restrict the object it can load to standard Java objects like List or Long. If you want to load custom POJOs you need to add theirs type to SnakeYAML DataFormat type filter list. If your source is trusted, you can set the property allowAnyType to true so SnakeYAML DataForma won't perform any filter on the types. -### Using YAML data format with the SnakeYAML library +=== Using YAML data format with the SnakeYAML library - Turn Object messages into yaml then send to MQSeries + @@ -111,7 +111,7 @@ from("activemq:My.Queue") .to("mqseries:Another.Queue"); ------------------------------------------------------------ -### Using YAML in Spring DSL +=== Using YAML in Spring DSL When using Data Format in Spring DSL you need to declare the data formats first. This is done in the *DataFormats* XML @@ -163,7 +163,7 @@ And then you can refer to those ids in the route: ------------------------------------- -### Dependencies for SnakeYAML +=== Dependencies for SnakeYAML To use YAML in your camel routes you need to add the a dependency on *camel-snakeyaml* which implements this data format.