Apache Camel 3.x Upgrade Guide
This document is for helping you upgrade your Apache Camel application from Camel 3.x to 3.y. For example if you are upgrading Camel 3.0 to 3.2, then you should follow the guides from both 3.0 to 3.1 and 3.1 to 3.2.
Upgrading Camel 3.3 to 3.4
camel-servlet and camel-http-common
HttpRegistry and DefaultHttpRegistry classes from camel-servlet are moved from camel-servlet into camel-http-common. HttpRegistryProvider is added and used in DefaultHttpRegistry instead of CamelServlet which is implementing HttpRegistryProvider since DefaultHttpRegistry is used in camel-resteasy component where CamelResteasy servlet also implementing HttpRegistryProvider.
These changes had effects on camel-atmosphere-websocket and camel-servlet and also camel-resteasy. Users of these components where they would have custom implemetations on DefaultHttpRegistry and using CamelServlet class should take this change into account.
camel-test and JMX
The camel-test
module no longer has dependency on camel-management
out of the box.
In Camel JMX is optional and to use JMX then camel-management
must be added as dependency.
For example to use JMX during testing you the following dependency as test scope:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-management</artifactId>
<scope>test</scope>
</dependency>
Template components
The template components which allows access to the current Exchange
and CamelContext
API
from the context map available for templating has now been restricted to only the message body and headers.
This option can be enabled (allowContextMapAll=true
) for full access to the current Exchange and CamelContext.
Doing so impose a potential security risk as this opens access to the full power of CamelContext API.
This applies to the following templating components: camel-freemarker, camel-velocity, camel-mvel, camel-mustache, camel-string-template, camel-chunk, camel-robotframework.
Using custom language in RouteBuilder
The Java DSL RouteBuilder
allows referring to a custom language as shown below:
from("direct:start")
.filter(language("foo", "Bla bla bla"))
.to("mock:camel");
This functionality is seldom in use, as you would use the provided languages from Camel.
If using, then the language
method now requires a static import as shown below:
import static org.apache.camel.builder.Builder.language;