Apache Camel new and noteworthy

This page lists some interesting new features in Apache Camel

Since Decision Insight 20210412

In Decision Insight 20200412 we upgraded Apache Camel to 3.7.2.

This version has a new modular design for faster loading time and lower memory footprint but breaks backward compatibility. See Apache Camel 3 migration guide.


Modular core

The core of Apache Camel is now split into several modules to have a faster loading time and a lower memory footprint.

Route single input

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")


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


Fix read lock issue

The readLock=fileLock option is now working as expected on Windows.


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.


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.


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 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.


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.


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.


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]}">
<setProperty propertyName="${body[propertyName]}">

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

    <!-- A "big" list -->
    <log message="Small chunk: ${body}" />

This example produces the following logs:

2017-03-21 16:14:00,352 [Camel (integration.test) thread #8 - timer://foo] INFO route1 - Small chunk: [a, b, c]
2017-03-21 16:14:00,353 [Camel (integration.test) thread #8 - timer://foo] INFO route1 - Small chunk: [d, e, f]
2017-03-21 16:14:00,354 [Camel (integration.test) thread #8 - timer://foo] INFO route1 - Small chunk: [g, h, i]
2017-03-21 16:14:00,354 [Camel (integration.test) thread #8 - timer://foo] INFO route1 - Small chunk: [j, k, l]

New string operators

There are 2 new string operators: "starts with" and "ends with". For instance you can write:

        <simple>${body} starts with 'ERROR'</simple>
        <log message="This is an error: ${body}"/>
        <simple>${body} ends with '!'</simple>
        <log message="This is important: ${body}"/>

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 timercomponent 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.


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.


Gson can now unmarshal to any JSON type (map, array).

If you have a JSON array for instance you can deserialize it with

    <json library="Gson"/>


Tar is now recognized as a standard data format.

Previously it was complicated to invoke the tar data format, you can now directly write


Since Decision Insight 20160215

In Decision Insight 20160215 we upgraded Apache Camel to 2.16.2.


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:

        <simple>${body[status]} =~ 'ERROR'</simple>
        <log message="There is an error"/>

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".


Configure buffer size for faster download

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.


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:

    <constant>SELECT * FROM PAYMENTS</constant>
<to uri="jdbc:oracle?outputType=StreamList"/>
    <log message="Process each database row as a stream" />


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.

Related Links