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.8 to 4.9

camel-api

Added setLazyBeanStrategy/getLazyBeanStrategy methods to org.apache.camel.spi.CamelBeanPostProcessor.

Renamed Exchange.ACTIVE_SPAN to Exchange.OTEL_ACTIVE_SPAN. Renamed ExchangePropertyKey.ACTIVE_SPAN to ExchangePropertyKey.OTEL_ACTIVE_SPAN.

camel-management

The queueSize attribute on endpoints which are ManagedBrowseableEndpoint is changed from returning a Long value to an Integer value.

camel-jackson

The option useWriter on JSon data format and camel-jackson, has been replaced with combineUnicodeSurrogates as it is intended for 4-bytes characters such as Japanese.

camel-jms

The camel-jms component has changed its default HeaderFilterStrategy to also remove any Camel…​ headers, to act similar to other Camel components. If the old classic behavior is needed then you can configure the JmsComponent to use org.apache.camel.component.jms.ClassicJmsHeaderFilterStrategy as header filter strategy which is the old implementation.

Added int limit as parameter to the browse method in org.apache.camel.component.jms.QueueBrowseStrategy.

camel-opentelemetry

The camel-opentelemetry component has had significant bug fixes to handle span activation/deactivations better when Camel route messages synchronously and asynchronously. This component should also work better on Spring Boot.

camel-smooks

Upgraded Smooks from 2.0.0-RC4 to 2.0.1 which has API breaking changes in Smooks.

camel-hashicorp-vault properties function

The syntax for retrieving a single field of a secret has been changed.

From this

{{hashicorp:secret:database/username}}

to this

{{hashicorp:secret:database#username}}

You could find more details on CAMEL-21179 issue

camel-aws-secrets-manager properties function

The syntax for retrieving a single field of a secret has been changed.

From this

{{aws:database/username}}

to this

{{aws:database#username}}

You could find more details on CAMEL-21179 issue

camel-google-secret-manager properties function

The syntax for retrieving a single field of a secret has been changed.

From this

{{gcp:database/username}}

to this

{{gcp:database#username}}

You could find more details on CAMEL-21179 issue

camel-azure-key-vault properties function

The syntax for retrieving a single field of a secret has been changed.

From this

{{azure:database/username}}

to this

{{azure:database#username}}

You could find more details on CAMEL-21179 issue

camel-aws

The camel-aws2-s3 when using headBucket operation will now store the result in a header named CamelAwsS3BucketExists whether the bucket exists or not.

Previously an software.amazon.awssdk.services.s3.model.NoSuchBucketException was thrown, however this would require to use error handling to just check whether the bucket existed. Returning a boolean makes it easier in Camel routes to decide what to do. You may also set the option ignoreBody=true to not change the message body.

camel-test

The CamelTestSupport class was modified so that the JUnit 5 extension code that was part of the class itself, was moved to a separate class. This is part of the work being done on CAMEL-20837 to modernize the base test code.

In many cases, code should work with no changes provided they are not using any of the API methods that were deprecated in Camel 4.7.0. Additionally, starting with Camel 4.9, we strongly recommend users to avoid relying on single-instance contexts (created via @TestInstance(TestInstance.Lifecycle.PER_CLASS)), as this is considered a deprecated functionality that will be removed in the future. The logs will print a warning message if this behavior is detected.

Removed deprecated components

The following experimental DSL has been removed:

  • camel-groovy-dsl

  • camel-js-dsl

  • camel-jsh-dsl

The Camel team is only focusing on Java, XML and YAML DSL.

Removed API

Kotlin DSL

The Kotlin DSL which was deprecated in Camel 4.7.0 has now been removed. The routes must be migrated to another DSL such as Java, Yaml or xml.

The following modules has been removed:

  • camel-kotlin-dsl

  • camel-kotlin-api