Apache Camel 4.x Upgrade Guide

This document is for helping you upgrade your Apache Camel application from Camel 4.x to 4.y. For example, if you are upgrading Camel 4.0 to 4.2, then you should follow the guides from both 4.0 to 4.1 and 4.1 to 4.2.

Upgrading Camel 4.9 to 4.10

XML DSL changes

In <intercept> and <interceptSendToEndpoint> then <when> has been renamed to <onWhen>.

For example:

<intercept>
  <when>...</when>
  ...
</intercept>

Should now be:

<intercept>
  <onWhen>...</onWhen>
  ...
</intercept>

In <circuitBreaker the <onFallback> section must be configured last.

For example:

  <circuitBreaker>
    <resilience4jConfiguration timeoutEnabled="true" timeoutDuration="2000"/>
    <onFallback>
      <transform>
        <constant>Fallback message</constant>
      </transform>
    </onFallback>
    <to uri="direct:foo"/>
    ...
  </circuitBreaker>

Should now be:

  <circuitBreaker>
    <resilience4jConfiguration timeoutEnabled="true" timeoutDuration="2000"/>
    <to uri="direct:foo"/>
    ...
    <onFallback>
      <transform>
        <constant>Fallback message</constant>
      </transform>
    </onFallback>
  </circuitBreaker>

camel-azure-files

The class org.apache.camel.component.file.azure.FilesHeaders has been renamed to org.apache.camel.component.file.azure.FilesConstants.

camel-file

The camel-file consumer has been optimized when filtering file names using name matching only, to avoid creating an GenericFile object that represent the file. This is unnessasary if the file is to be excluded due the filtering.

This optimization has changed APIs in the camel-file component to let methods that accept GenericFile as parameter, has been changed to use a Supplier<GenericFile> to lazy create the wrapper.

Camel users who have created 3rd party component extending camel-file may need to migrate your components.

camel-jgroups

The cluster lock has been removed as it has been removed in JGroups 5.4 onwards, and it was not recommended to be used in older JGroups releases. You can use another Camel component such as camel-infinispan that has cluster locking.

The camel-jgroups-cluster-service-starter in Camel Spring Boot has been removed.

camel-jbang

The camel-jbang commands for camel-k has been removed.

camel-mina

If using object codec, then you should configure the objectCodecPattern configuration to specify which java classes (FQN) to allow for Object serialization. You can use * to accept all patterns.

camel-google-pubsub-lite

The component camel-google-pubsub-lite has been deprecated following the deprecation of the corresponding service by Google Cloud Platform.

Google recommends migrating your Pub/Sub Lite service to either Google Cloud Managed Service for Apache Kafka or Google Cloud Pub/Sub. Depending on your choice, you should use camel-kafka or camel-google-pubsub component, respectively.

camel-spring-boot

The camel-k-starter has been removed.

camel-tracing

We have deprecated the setting of MDC trace_id and span_id in favour of implementation specific feature. You need to check the specific tracing/telemetry component configuration to learn how to switch from the deprecated configuration to the new one. Most of the time you will need to remove the camel.main.use-mdc-logging Camel property (or set it to false) and add dependencies and configuration settings to enable the specific component instrumentation.

camel-langchain4j-chat

The function calling feature was removed. Please use the camel-langchain4j-tools component for function calling.

camel-smb

The camel-smb component has been updated to extend GenericFile classes and now supports more consumer and producer options. The Consumer includes options for filtering, pre and post processing, duplicate handling, directory traversal, polling, and readlocks. The Producer includes options for writing to temporary files, writing content, and handling existing files.