Apache Camel new and noteworthy
Since Decision Insight 20210412
In Decision Insight 20200412 we upgraded Apache Camel to 3.7.2.
Core
Modular core
The core of Apache Camel is now split into several modules to have a faster loading time and a lower memory footprint.
Within a <route>
tag you can now only write a single <from uri="..." />
tag in them.
Strict boolean evaluation
When parsing boolean parameter now only "true" and "false" are supported, other values will throw an exception (previously, other values were evaluated to "false")
JMS
Reconnection support in SJMS
camel-sjms is the new standard for JMS, replacing camel-jms and its Spring dependency. It now has reconnection support in case of exception
Since Decision Insight 20200622
In Decision Insight 20200622 we upgraded Apache Camel to 2.25.1
File
Fix read lock issue
The readLock=fileLock
option is now working as expected on Windows.
JMS
Non-durable shared subscription
The JMS component now supports non-durable shared subscription which was introduced in JMS 2.0.
Since Decision Insight 20190930
In Decision Insight 20190930 we upgraded Apache Camel to 2.24.1.
Core
Improved direct component
Direct component now blocks by default if sending to a consumer which is not yet ready, which may happen during startup (little window of opportunity). This avoids exceptions being thrown during startup.
Default seda queue size is not limited
The SEDA component now has a default queue size of 1000 instead of unlimited.
FTP
Display of transfer progress
The FTP component can now log progress (turn on transferLoggingLevel
) when performing download/upload and other operations
Automatic resuming in case of network disconnection
Added support for resuming downloads to FTP component. For example if you download big files and has connection problems with the FTP server. Then later when the connectivity works again, Camel can resume download the in-progress file.
JMS
JMS 2.0 support
The JMS component now includes JMS 2.0 functionality to use shared (durable and non-durable) topic.
New camel-sjms2 component
There's a new JMS 2.0 api compatible component of the SJMS component.
Kafka
Autocommit on stop
The Kafka consumer will now auto commit on stop to ensure the broker has the latest offset commit. The option autoCommitOnStop
can be configured to be sync
, async
or none
.
Reconnect upon error
Allow Kafka consumer to break on first unhandled exception, sync the offset from last known good, and then re-connect after one timeout cycle, to restart consuming again. This avoids loosing the failed message, but retry it again on either this consumer, or another consume which was re-balanced by Kafka. This requires to be turned on with the new option breakOnFirstError
which can be set on both component or endpoint level.
Header support
The Kafka component now supports HeaderFilterStrategy
to plugin custom implementations for controlling header mappings between Camel and Kafka messages.
Restlet
Use of standard {param}
notation
The Restlet component is now internally using curly brackets for its uri patterns instead of regular parentheses so it works similar to the other REST component and as Restlet framework itself does
SQL Stored Procedure
Support of INOUT
parameters
The SQL Stored Procedure component now supports INOUT parameters.
Since Decision Insight 20170417
In Decision Insight 20170417 we upgraded Apache Camel to 2.18.3.
Core
Dynamic header and exchange property keys
It's now possible to compute dynamically the name of a header or an exchange property. For instance you can write
<setHeader headerName="${body[headerName]}">
<constant>Value</constant>
</setHeader>
<setProperty propertyName="${body[propertyName]}">
<constant>Value</constant>
</setProperty>
Split a big list into smaller ones
Imagine that you have a huge list, containing thousands items and you want to process them by "chunk" then you can use the collate
function in Simple. For instance you can write
<setBody>
<!-- A "big" list -->
<groovy>["a","b","c","d","e","f","g","h","i","j","k","l"]</groovy>
</setBody>
<split>
<simple>${collate(3)}</simple>
<log message="Small chunk: ${body}" />
</split>
This example produces the following logs:
New string operators
There are 2 new string operators: "starts with
" and "ends with
". For instance you can write:
<choice>
<when>
<simple>${body} starts with 'ERROR'</simple>
<log message="This is an error: ${body}"/>
</when>
<when>
<simple>${body} ends with '!'</simple>
<log message="This is important: ${body}"/>
</when>
</choice>
Easier file filters
You can now use simple predicate expression to filter the file. For instance you can write:
<from uri="file:/path/to/folder/?filterFile=${file:name} ends with '0.txt'"/>
That will only read the files where the name ends with 0.txt
.
"As fast as possible" timer
You can now set the delay
to -1
in order to make the timer
component as fast as possible. For instance you can write
<from uri="timer:fast?delay=-1"/>
<to uri="log:fast?groupInterval=10000"/>
This produces an average of 180k messages per second.
FTP
Improved stability with SFTP
There was an issue with FTP / FTPS / SFTP where the SFTP connection took lots of time to establish the connection. This issue is now fixed.
JSON
Gson can now unmarshal to any JSON type (map, array).
If you have a JSON array for instance you can deserialize it with
<unmarshal>
<json library="Gson"/>
</unmarshal>
Tar
Previously it was complicated to invoke the tar
data format, you can now directly write
<unmarshal>
<tarfile/>
</unmarshal>
Since Decision Insight 20160215
In Decision Insight 20160215 we upgraded Apache Camel to 2.16.2.
Core
New operator for testing string equality with ignored case
There is a new =~
operator in simple language, it tests if 2 String are equals without the case. For instance you can write:
<choice>
<when>
<simple>${body[status]} =~ 'ERROR'</simple>
<log message="There is an error"/>
</when>
</choice>
In that case, the log message will work no matter the case of the status
: "ERROR", "error", "Error" or even "ErRoR"
New dynamic router
Thanks to the <toD />
XML tag it's now easier to route messages to a dynamic endpoint. For instance you can write:
<toD uri="direct:process${body[type]}" />
In that case you can call direct:processStep
or direct:processAccount
dependending whether ${body[type]}
is equals to Step
or Account
.
exchangeProperty
replaces property
In order to avoid ambiguity, confusion and clash with properties, the metadata properties of the exchange are now named "exchangeProperty".
FTP
It's now possible to configure the buffer size for faster FTP downloads. For instance you can write
<from uri="ftp://user@service?receiveBufferSize=1048576"/>
That will provide a 1Mb buffer size for downloading file content. Obviously you can download files that are larger than the buffer, configuring a big buffer produces fewer roundtrips to the FTP server but consumes more memory. By default it's a buffer of 32kb.
JDBC
New StreamList
option
There is a new option in the JDBC (Databases) component that allows to stream the result of the database result. For instance you can write:
<setBody>
<constant>SELECT * FROM PAYMENTS</constant>
</setBody>
<to uri="jdbc:oracle?outputType=StreamList"/>
<split>
<simple>${body}</simple>
<log message="Process each database row as a stream" />
</split>
JMS
Faster shutdown of routes that consumes JMS messages
In previous versions of Apache Camel there were an issue that prevented to properly stop a route consuming JMS messages with a heavy load. This issue is now fixed.