For the list of all supported Decision Insight downloads and releases, see the Downloads page.

Apache Camel new and noteworthy

This page lists some interesting new features in Apache Camel

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

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.

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.

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:

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:

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

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

Tar is now recognized as a standard data format.

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

<unmarshal>
    <tarfile/>
</unmarshal>

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.

Related Links