Author: buildbot Date: Sat Aug 8 10:20:10 2015 New Revision: 961140 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-in-one-page.html websites/production/camel/content/book-languages-appendix.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/file-language.html Modified: websites/production/camel/content/book-in-one-page.html ============================================================================== --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Sat Aug 8 10:20:10 2015 @@ -3685,11 +3685,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful.
Thanks
This tutorial was kindly donated to Apache Camel by Martin Gilday.
This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a Spring service. The route works in a synchronous fashion returning a response to the client.
This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis.
The Simple language is part of camel-core.
-File language is now merged with Simple language
From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.
The File Expression Language is an extension to the Simple language, adding file related capabilities. These capabilities are related to common use cases working with file path and names. The goal is to allow expressions to be used with the File and FTP components for setting dynamic file patte rns for both consumer and producer.
This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.
All the file tokens use the same expression name as the method on the java.io.File
object, for instance file:absolute
refers to the java.io.File.getAbsolute()
method. Notice that not all expressions are supported by the current Exchange. For instance the FTP component supports some of the options, where as the
File component supports all of them.
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 below) |
file:name.ext | String | yes | no | yes | no | Camel 2.3: refers to the file extension only |
file:name.noext | String | yes | no | yes | no | refers to the file name with no extension (is relative to the starting directory, see note below) |
file:onlyname | String | yes | no | yes | no | refers to the file name only with no leading paths. |
file:onlyname.noext | String | yes | no | yes | no | refers to the file name only with no extension and with no leading paths. |
file:ext | String | yes | no | yes | no | refers to the file extension only |
file:parent | String | yes < /td> | no | yes | no | refers to the file parent |
file:path | String | yes | no | yes | no | refers to the file path |
file:absolute | Boolean | yes | no | no | no | refers to whether the file is regarded as absolute or relative |
file:absolute.path | String | yes | no | no | no | refers to the absolute file path |
file:length | Long | yes | no | yes | no | refers to the file length returned as a Long type |
file:size | Long | yes | no | yes | no | Camel 2.5: refers to the file length returned as a Long type |
file:modified | Date | yes | no | yes | no | efers to the file last modified returned as a Date type |
date:command:pattern | String | yes | yes | yes | yes | for date formatting using the |
We have a java.io.File
handle for the file hello.txt
in the following relative directory: .\filelanguage\test
. And we configure our endpoint to use this starting directory .\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | filelanguage\test |
file:path | fil elanguage\test\hello.txt |
file:absolute | false |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
We have a java.io.File
handle for the file hello.txt
in the following absolute directory: \workspace\camel\camel-core\target\filelanguage\test
. And we configure out endpoint to use the absolute starting directory \workspace\camel\camel-core\target\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | \workspace\camel\camel-core\target\filelanguage\test |
file:path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
file:absolute | true |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
You can enter a fixed Constant expression such as myfile.txt
:
File language is now merged with Simple language
From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.
The File Expression Language is an extension to the Simple language, adding file related capabilities. These capabilities are related to common use cases working with file path and names. The goal is to allow expressions to be used with the File and FTP components for setting dynamic file patte rns for both consumer and producer.
This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.
All the file tokens use the same expression name as the method on the java.io.File
object, for instance file:absolute
refers to the java.io.File.getAbsolute()
method. Notice that not all expressions are supported by the current Exchange. For instance the FTP component supports some of the options, where as the
File component supports all of them.
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 below) |
file:name.ext | String | yes | no | yes | no | Camel 2.3: refers to the file extension only |
file:name.singleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file extension. If the file extension has mutiple dots, then this expression strips and only returns the last part. |
file:name.noext | String | yes | no | yes | no | refers to the file name with no extension (is relative to the starting directory, see note below) |
file:name.nosingleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file name with no extension (is relative to the starting directory, see note below). If the file extension has multiple dots, then this expression strips only the last part, and keep the others. |
file:onlyname | String | yes | no | yes | no | refers to the file name only with no leading paths. |
file:onlyname.noext | String | yes | no | yes | no | refers to the file name only with no extension and with no leading paths. |
file:onlyname.nosingleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file name only with no extension and with no leading paths. If the file extension has multiple dots, then this expression strips only the last part, and keep the others. |
file:ext | String | yes | no | yes | no | refers to the file extension only |
file:parent | String | yes | no | yes | no | refers to the file parent |
file:path | String | yes | no | yes | no | refers to the file path |
file:absolute | Boolean | yes | no | no | no | refers to whether the file is regarded as absolute or relative |
file:absolute.path | String | yes | no | no | no | refers to the absolute file path |
file:length | Long | yes | no | yes | no | refers to the file length returned as a Long type |
file:size | Long | yes | no | yes | no | Camel 2.5: refers to the file length returned as a Long type |
file:modified | Date | yes | no | yes | no | efers to the file last modified returned as a Date type |
date:command:pattern | String | yes | yes | yes | yes | for date formatting using the |
We have a java.io.File
handle for the file hello.txt
in the following relative directory: .\filelanguage\test
. And we configure our endpoint to use this starting directory .\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | filelanguage\test |
file:path | filelanguage\test\hello.txt |
file:absolute | false |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
We have a java.io.File
handle for the file hello.txt
in the following absolute directory: \workspace\camel\camel-core\target\filelanguage\test
. And we configure out endpoint to use the absolute starting directory \workspace\camel\camel-core\target\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | \workspace\cam el\camel-core\target\filelanguage\test |
file:path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
file:absolute | true |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
You can enter a fixed Constant expression such as 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:
When using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.
When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.
The cxf: component provides integration with Apache CXF for connecting to JAX-WS services hosted in CXF.
The Simple language is part of camel-core.
-File language is now merged with Simple language
From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.
The File Expression Language is an extension to the Simple language, adding file related capabilities. These capabilities are related to common use cases working with file path and names. The goal is to allow expressions to be used with the File and FTP components for setting dynamic fi le patterns for both consumer and producer.
This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.
All the file tokens use the same expression name as the method on the java.io.File
object, for instance file:absolute
refers to the java.io.File.getAbsolute()
method. Notice that not all expressions are supported by the current Exchange. For instance the FTP component supports some of the options, where as the File component supports all of them.
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 below) |
file:name.ext | String | yes | no | yes | no | Camel 2.3: refers to the file extension only |
file:name.noext | String | yes | no | yes | no | refers to the file name with no extension (is relative to the starting directory, see note below) |
file:onlyname | String | yes | no | yes | no | refers to the file name only with no leading paths. |
file:onlyname.noext | String | yes | no | yes | no | refers to the file name only with no extension and with no leading paths. |
file:ext | String | yes | no | yes | no | refers to the file extension only |
file:parent | String | yes | no | yes | no | refers to the file parent |
file:path | String | yes | no | yes | no | refers to the file path |
file:absolute | Boolean | yes | no | no | no | refers to whether the file is regarded as absolute or relative |
file:absolute.path | String | yes | no | no | no | refers to the absolute file path |
file:length | Long | yes | no | yes | no | refers to the file length returned as a Long type |
file:size | Long | yes | no | yes | no | Camel 2.5: refers to the file length returned as a Long type |
file:modified | Date | yes | no | yes | no | efers to the file last modified returned as a Date type |
date:command:pattern | String | yes | yes | yes | yes | for date formatting using the |
We have a java.io.File
handle for the file hello.txt
in the following relative directory: .\filelanguage\test
. And we configure our endpoint to use this starting directory .\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | filelanguage\test |
file:path | filelanguage\test\hello.txt |
file:absolute | false |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
We have a java.io.File
handle for the file hello.txt
in the following absolute directory: \workspace\camel\camel-core\target\filelanguage\test
. And we configure out endpoint to use the absolute starting directory \workspace\camel\camel-core\target\filelanguage
. The file tokens will return as:
Expressi on | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | \workspace\camel\camel-core\target\filelanguage\test |
file:path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
file:absolute | true |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
You can enter a fixed Constant expression such as myfile.txt
:
File language is now merged with Simple language
From Camel 2.2 onwards, the file language is now merged with Simple language which means you can use all the file syntax directly within the simple language.
The File Expression Language is an extension to the Simple language, adding file related capabilities. These capabilities are related to common use cases working with file path and names. The goal is to allow expressions to be used with the File and FTP components for setting dynamic fi le patterns for both consumer and producer.
This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.
All the file tokens use the same expression name as the method on the java.io.File
object, for instance file:absolute
refers to the java.io.File.getAbsolute()
method. Notice that not all expressions are supported by the current Exchange. For instance the FTP component supports some of the options, where as the File component supports all of them.
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 below) |
file:name.ext | String | yes | no | yes | no | Camel 2.3: refers to the file extension only |
file:name.singleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file extension. If the file extension has mutiple dots, then this expression strips and only returns the last part. |
file:name.noext | String | yes | no | yes | no | refers to the file name with no extension (is relative to the starting directory, see note below) |
file:name.nosingleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file name with no extension (is relative to the starting directory, see note below). If the file extension has multiple dots, then this expression strips only the last part, and keep the others. |
file:onlyname | String | yes | no | yes | no | refers to the file name only with no leading paths. |
file:onlyname.noext | String | yes | no | yes | no | refers to the file name only with no extension and with no leading paths. |
file:onlyname.nosingleext | String | yes | no | yes | no | Camel 2.14.4/2.15.3: refers to the file name only with no extension and with no leading paths. If the file extension has multiple dots, then this expression strips only the last part, and keep the others. |
file:ext | String | yes | no | yes | no | refers to the file extension only |
file:parent | String | yes | no | yes | no | refers to the file parent |
file:path | String | yes | no | yes | no | refers to the file path |
file:absolute | Boolean | yes | no |
no | no | refers to whether the file is regarded as absolute or relative |
file:absolute.path | String | yes | no | no | no | refers to the absolute file path |
file:length | Long | yes | no | yes | no | refers to the file length returned as a Long type |
file:size | Long | yes | no | yes | no | Camel 2.5: refers to the file length returned as a Long type |
file:modified | Date | yes | no | yes | no | efers to the file last modified returned as a Date type |
date:command:pattern | String | yes | yes | yes | yes | for date formatting using the |
We have a java.io.File
handle for the file hello.txt
in the following relative directory: .\filelanguage\test
. And we configure our endpoint to use this starting directory .\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | filelanguage\test |
file:path | filelanguage\test\ hello.txt |
file:absolute | false |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
We have a java.io.File
handle for the file hello.txt
in the following absolute directory: \workspace\camel\camel-core\target\filelanguage\test
. And we configure out endpoint to use the absolute starting directory \workspace\camel\camel-core\target\filelanguage
. The file tokens will return as:
Expression | Returns |
---|---|
file:name | test\hello.txt |
file:name.ext | txt |
file:name.noext | test\hello |
file:onlyname | hello.txt |
file:onlyname.noext | hello |
file:ext | txt |
file:parent | \workspace\camel\camel-core\target\filelanguage\test |
file:path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
file:absolute | true |
file:absolute.path | \workspace\camel\camel-core\target\filelanguage\test\hello.txt |
You can enter a fixed Constant expression such as 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: