Fuse ESB Enterprise 7.1.0.fuse-047 uses Apache Camel 2.10. Since the last release, Apache Camel has been upgraded from version 2.9 to version 2.10. This introduces a few migration issues.
The most important change in Apache Camel 2.10 is that Apache Camel now supports Java 7 (JDK 1.7).
You should also note the following important changes:
Maven 3.0.2 or better is required to build the source.
In Apache Camel 2.10, some components have had their third party dependencies upgraded. See Product Dependencies for details.
In Apache Camel 2.10, the following changes have been made to the Java API:
- ShutdownStrategy
Since Apache Camel version 2.10, the
shutdownForcedandforceShutdownmethods have been added to theorg.apache.camel.spi.ShutdownStrategyinterface.- ShutdownAware
Since Apache Camel version 2.10, the
ShutdownAwareinterface inherits from theShutdownPreparedinterface, which defines the additionalprepareShutdownmethod.- RouteBuilder
Since Apache Camel version 2.10, the
errorHandlermethod from theorg.apache.camel.builder.RouteBuilderinterface returnsvoid.- SimpleLanguage
Since Apache Camel version 2.10, the
SimpleLanguageconstructor that takes custom start and end tokens has been removed. Use the staticSimpleLanguage.changeFunctionStartTokenmethod and theSimpleLanguage.changeFunctionEndTokenmethod instead.- LifecycleStrategy
Since Apache Camel version 2.10, the
onThreadPoolRemovemethod and theonErrorHandlerRemovemethod have been added to theorg.apache.camel.spi.LifecycleStrategyinterface.- OnExceptionDefinition
Since Apache Camel version 2.10, the
retryWhile(Expression)method has been removed from theorg.apache.camel.model.OnExceptionDefinitioninterface. Use theretryWhile(Predicate)method instead.- TypeConverter
Since Apache Camel version 2.10, the
convertTomethods onorg.apache.camel.TypeConverterthrowTypeConversionException, if an exception occurs during type conversion. NewtryConvertTomethods have been added toTypeConverter, which ignore any exceptions that might occur during conversion.- Message
Since Apache Camel version 2.10, the
getBody(type)method and thegetHeader(name, type)method fromorg.apache.camel.Messagenow throwTypeConversionException, if an exception occurs during type conversion.- UnitOfWork
Since Apache Camel version 2.10, the
containsSynchronizationmethod has been added to theorg.apache.camel.spi.UnitOfWorkinterface.- Exchange
Since Apache Camel version 2.10, the
containsSynchronizationmethod has been added to theorg.apache.camel.Exchangeinterface.Since Apache Camel version 2.10, the
isTransactionRedeliveredmethod has been added to theorg.apache.camel.Exchangeinterface.- CamelContext
Since Apache Camel version 2.10, the
setManagementNamemethod has been removed fromorg.apache.camel.CamelContext.- GenericFile
Since Apache Camel version 2.10, the
isDirectorymethod has been added to theorg.apache.camel.component.file.GenericFileinterface.- TypeConverterRegistry
Since Apache Camel version 2.10, the
getStatisticsmethod has been added to theorg.apache.camel.spi.TypeConverterRegistryinterface.- GenericFileProcessStrategy
Since Apache Camel version 2.10, the
abortmethod has been added to theorg.apache.camel.component.file.GenericFileProcessStrategyinterface.
In Apache Camel 2.10, you need to consider the following component updates:
Netty component—removed the
corePoolSizeandmaxPoolSizethread pool options.The API for the
ClientPipelineFactoryandServerPipelineFactoryabstract classes has changed.CXFRS component—the
resourceClassesoption no longer recognizes the semicolon character,;, as a separator for class names. Use the comma character,,, instead.Mail component—now excludes the dependency on the
javax.activationJAR, because that dependency is embedded in the JVM from Java 6 onwards.Test component—Spring testing features have been moved from the
camel-testartifact to thecamel-test-springartifact.File component—you can now use the
charsetoption on the File component to specify the character encoding to use for reading and writing files.
The simple language no longer trims white space surrounding an expression in the Java
DSL. On the other hand, the simple language does trims white space surrounding an expression
in the XML DSL by default, but you can disable this behavior by setting
trim="false" in the simple element.
In this release, the convertBodyTo DSL command does
not propagate the character set as an exchange property when the
charset option is set (in previous releases, the character set was propagated
in the Exchange.CHARSET_NAME property).
URI normalization now recognizes pre-existing %nn decimal encodings in URI
strings.
When using Apache Camel interceptors, the behavior when combining the
skipSendToOriginalEndpoint() clause with the when() predicate
has changed in Apache Camel 2.10.
Now, when you combine the skipSendToOriginalEndpoint() clause with a
when() predicate, the original endpoint is skipped, only if the
when() predicate evaluates to true. For example, in the
following route, the mock:result endpoint will be skipped, only if the message
body is equal to Hello World:
interceptSendToEndpoint("mock:foo")
.skipSendToOriginalEndpoint()
.when(body().isEqualTo("Hello World"))
.to("mock:detour").transform(constant("Bye World"));
from("direct:second")
.to("mock:bar")
.to("mock:foo")
.to("mock:result");In previous versions, the original endpoint would have been skipped, even if the
when() predicate evaluated to false.
The default pattern for thread names is now:
Camel (#camelId#) thread ##counter# - #name#
In previous releases the thread name pattern was:
Camel (${camelId}) thread #${counter} - ${name}The pollEnrich DSL command now blocks, if no messages are available and no
timeout has been configured.
The setting lazyLoadTypeConverter=true is now deprecated and will be
removed in a future release. The recommended practice is to load type converters at start up
time.
The Apache Camel test kit no longer lazily loads type converters.
Apache Camel now fails faster during type conversion, by throwing
TypeConversionException to the caller.
Apache Camel no longer supports using java.beans.PropertyEditor for type
conversion. This approach is slow, not thread safe, and uses third party JARs on the
classpath, which can cause unwanted side effects.








