User manual

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.

The Camel Upgrade Recipes project provides automated assistance for some common migration tasks. Note that manual migration is still required. See the documentation page for details.

Upgrading Camel 4.24 to 4.25

Rest DSL - CORS credentials require a configured origin

When CORS is enabled with Access-Control-Allow-Credentials=true (corsAllowCredentials(true)) and Access-Control-Allow-Origin is left at its default *, the response no longer echoes the Origin of the request and leaves out Access-Control-Allow-Credentials. Camel logs a WARN when the routes start. To allow credentials, configure the allowed origin, for example corsHeaderProperty("Access-Control-Allow-Origin", "https://app.example.com"). This matches what platform-http-vertx and camel-a2a already do.

camel-langchain4j-agent - deprecate response model header

The CamelLangChain4jAgentResponseModel header is now deprecated because the LangChain4j agent Result does not expose the response model name. The producer did not populate this header, so applications should not rely on it.

camel-langchain4j-agent - trim excluded tool tags and MCP server names

The CamelLangChain4jAgentExcludeTags and CamelLangChain4jAgentExcludeMcpServers headers now correctly handle whitespace around comma-separated names.

Modeline (//DEPS lines in route files) deprecated

Modeline, the JBang style //DEPS lines in route files that camel run reads to download extra dependencies, is deprecated, and will be removed in a future release. Camel logs a WARN for each route file that has //DEPS lines. Declare the dependencies in application.properties instead:

camel.jbang.dependencies=com.example:my-library:1.0,com.example:other-library:2.1

or with camel run --dep. Deprecated with it: the camel-dsl-modeline component, the camel.main.modeline option, CamelContext.setModeline / isModeline, the ModelineFactory SPI and the camel run --modeline option. The camel dependency list and camel dependency update commands keep handling the //DEPS lines of JBang scripts.

camel-azure-schema-registry - deprecated

The camel-azure-schema-registry component is deprecated, and will be removed in a future release. Its only class, DefaultAzureCredentialWrapper, gave the Azure Schema Registry serializers of Kafka a DefaultAzureCredential created by class name; the Kamelets that used it were removed from the Kamelet catalog. Create the credential as a bean with the builder of Azure Identity instead:

- beans:
    - name: defaultAzureCredential
      type: com.azure.identity.DefaultAzureCredential
      builderClass: com.azure.identity.DefaultAzureCredentialBuilder

camel-pqc - default-material accessors and provider resolution

The PQCDefault*Material helper classes now initialize their default cryptographic material lazily. Their backing fields (keyPair, signer, keyGenerator and generator) are private. Application code that accessed those fields directly must migrate to the corresponding accessors, for example getKeyPair(), getSigner(), getKeyGenerator() and getGenerator(). Hybrid material holders expose the specific accessors for their classical and PQC material, such as getClassicalKeyPair(), getClassicalKeyAgreement(), getPqcKeyPair(), getPqcKeyGenerator() and getMaterial().

The no-argument PQCKeyEncapsulationAlgorithms.getBcProvider() and PQCSignatureAlgorithms.getBcProvider() methods are deprecated. Use getBcProvider(serviceType) with the JCA service being requested (KeyPairGenerator, Signature, KeyGenerator, KeyFactory, and so on). Provider selection is now service-specific and can return BC where older code expected BCPQC; applications must not hard-code the provider name for a PQC algorithm.

For a recognized algorithm, KeyAlgorithmSupport.getDefaultParameterSpec() now throws an IllegalStateException when the runtime cannot resolve that algorithm’s configured default parameter set. Previously such a failure could be reported as a missing default (null) and lead to a fallback key size. Unknown algorithm names still return null. Applications should allow a parameter-resolution failure to stop key generation rather than silently use a different key size or parameter set.

The producer body metadata for KEM operations now declares the standard javax.crypto.SecretKey type instead of a Bouncy Castle-specific carrier type. Applications should accept the JCA SecretKey interface; the runtime may still return Bouncy Castle’s encapsulation-carrying implementation when that provider class is available.

camel-kafka, camel-kafka-share - sslContextParameters now configures the complete TLS engine

The Kafka components now create their TLS engines from the complete SSLContext produced by Camel’s sslContextParameters, rather than translating a subset of the parameters into Kafka ssl.* properties. This applies whether the parameters are configured on the endpoint or supplied through the global SSL context (useGlobalSslContextParameters). Key and trust managers, cipher suites, enabled protocols, named groups, signature schemes and Camel’s post-quantum named-group preference (when available) are now applied. A KeyManager supplied directly through KeyManagersParameters is supported.

This changes the precedence of SSL options. When sslContextParameters is configured, all Kafka-specific SSL endpoint options other than sslEndpointAlgorithm, and additionalProperties entries whose names start with ssl., are ignored. Camel logs a warning listing non-default SSL endpoint option names and ignored additional-property names, without logging their values. The sslEndpointAlgorithm option continues to control broker hostname verification. Applications that previously overrode SSL settings from sslContextParameters with Kafka SSL endpoint options or additionalProperties must move those settings into the endpoint’s own sslContextParameters. This is especially important when a global SSL context is used and an endpoint previously selected a different trust store.

Because Kafka now uses the Camel-created SSLContext, explicit namedGroups and signatureSchemes are applied. A broker that cannot negotiate one of the explicitly configured named groups may no longer connect. The automatic post-quantum named-group preference is also applied when supported by the JVM. The jdk.tls.namedGroups, jdk.tls.client.SignatureSchemes and jdk.tls.server.SignatureSchemes system-property workaround documented for Kafka in the 4.24 upgrade guide is no longer needed when using sslContextParameters; those JVM-wide properties may still be relevant to other TLS clients.

Without sslContextParameters, the existing Kafka ssl.* endpoint options and additionalProperties behavior is unchanged.

camel-openai - oauthProfile takes precedence over apiKey

When both oauthProfile and apiKey are set on a camel-openai endpoint, oauthProfile now takes precedence and the apiKey is ignored. Before, apiKey took precedence over oauthProfile. This reversal matches the option descriptions and the behaviour of the other AI components. Applications that intentionally configured both options relying on apiKey taking precedence must remove the oauthProfile option or set it to empty to restore the previous resolution order.

Additionally, a misconfigured oauthProfile on the OpenAI API client (the oauthProfile option on the endpoint itself, not on a nested mcpServer.*) will only be reported on the first exchange rather than at route startup. This is an intentional trade-off that enables short-lived token refresh.

camel-docling - the OAuth token of oauthProfile is resolved per request

With oauthProfile, the endpoint used to resolve the access token once at startup and bake it into the docling-serve client. The token is now resolved from the camel-oauth cache on every outbound request so that short-lived tokens are automatically renewed when they expire without restarting the route. The identity provider must issue tokens that docling-serve accepts as Bearer credentials.

The trade-off: a misconfigured profile name, a missing camel-oauth dependency, or an unreachable identity provider used to fail the route at startup and now causes an exception on the first exchange. The exception is handled by the route’s error handler like any other exchange failure.

If authenticationScheme=API_KEY and authenticationToken are also set together with oauthProfile, the OAuth token is now sent as Authorization: Bearer while the static token is sent as X-Api-Key. Previously the OAuth token was resolved once at startup and also sent as X-Api-Key. Both headers are sent when both are configured; use oauthProfile alone (without authenticationScheme or authenticationToken) to send only the Bearer token.

Camel CLI - the Azure Storage Queue dev service runs on Floci AZ

camel infra run azure storage-queue now starts the Queue service of Floci AZ instead of Azurite, as the other Azure dev services already did. Floci AZ serves all its services on port 4577, and the Queue service of the devstoreaccount1 account under /devstoreaccount1-queue. A client of the dev service, such as a QueueServiceClient set in the serviceClient option of azure-storage-queue, needs the address http://localhost:4577/devstoreaccount1-queue instead of http://localhost:10001/devstoreaccount1. The account name and key do not change. The Blob dev service still runs on Azurite.

camel-alibaba-eventbridge - a CloudEvent body cannot carry extensions that reuse reserved attribute names

When the body sent to the alibaba-eventbridge producer is a CloudEvent instance, its extensions map must not contain a key that reuses a reserved CloudEvents core attribute name (id, source, specversion, type, datacontenttype, dataschema, subject, time, data or data_base64), compared case-insensitively. The Alibaba SDK serializes a request by flattening each extension up to a top-level attribute, so such an extension would replace the dedicated attribute of the same name that the producer set and validated. The producer now rejects such an event with an IllegalArgumentException.

The producer also writes the resolved event bus, source and type back onto a CloudEvent body before it is sent, so the request carries exactly the values that were validated. The CloudEvent instance given as the body is updated in place: the bus is written onto the aliyuneventbusname extension, the only bus key the SDK serializes on the wire, on a copy of the extensions map from which the aliyunEventBus and eventBusName hint keys are removed, and the source and type onto the dedicated fields. A bus, source or type that was resolved from the endpoint options, or a bus taken from one of the two hint keys, is therefore now serialized and sent rather than validated and silently dropped.

Routes that copy arbitrary key/value pairs into a CloudEvent extensions map should drop these reserved names before sending. The Map and JSON-text body forms build a fresh event and are not affected.

camel-alibaba-eventbridge - the client that the endpoint creates sends its requests over HTTPS

The client that the alibaba-eventbridge endpoint creates now sends its requests to EventBridge over HTTPS. Before, it sent them over HTTP, the protocol that EventBridgeClient of the SDK uses when its Config sets none. The new tls option, true by default, sets the protocol.

A route whose endpoint option names a host that accepts only HTTP needs tls=false now. A client that is set or autowired in the eventBridgeClient option keeps its own protocol.

camel-alibaba-sms - sendSms fails the exchange for a Code other than OK

The sendSms operation of alibaba-sms now fails the exchange for a response with a Code other than OK. A response without a Code or without a body fails the exchange too. Short Message Service gives some error codes, such as InternalError, the HTTP status 200. Only the Code OK means success. Before, the exchange completed, and the code key of the body held the error code.

The exception is a com.aliyun.tea.TeaException in the form that the SDK throws for an HTTP status from 400 to 599. getCode() gives the Code, getStatusCode() the HTTP status, and getData() the fields of the response, such as BizId and RequestId. So one onException(TeaException.class) handles a Code other than OK and an HTTP status from 400 to 599. The body then stays as it was, and the producer does not set the CamelAlibabaSmsRequestId header.

A route that tests the code key of the body for an error needs onException, or doTry and doCatch, now. An error handler that redelivers now sends such a request again. A test that mocks the client must return a body with the Code OK for a send that succeeds.

camel-alibaba-oss - listBuckets returns every bucket, and listObjects uses ListObjectsV2

The listBuckets operation of alibaba-oss now returns every bucket of the account. Before, it returned only the first page of the listing, which Object Storage Service limits to 100 buckets by default. It now asks for 1000 buckets per request, and sends requests until the listing ends.

The listObjects operation now sends ListObjectsV2 requests instead of ListObjects, as the consumer does. It needs the same oss:ListObjects permission. A custom OSSClient, or a test that mocks it, must now implement or mock listObjectsV2 for this operation. The body is the same List of Map, with the same keys.

Without maxKeys, the producer now asks for 999 objects per request. Before, it set no page size, so the service sent its default of 100 objects. With maxKeys, each request asks for at most 999 objects, until the producer has maxKeys objects or the listing ends. Before, it sent maxKeys as the page size of every request, and the service rejected a value above 1000. Returning 1000 objects now takes two requests. When more objects match, listObjects now also sets the new CamelAlibabaOssNextContinuationToken header.

camel-xmlsecurity - non-GCM data ciphers rejected when GCM is configured

When XMLSecurityDataFormat is configured with an AES-GCM xmlCipherAlgorithm (including the default AES_256_GCM), unmarshal() now rejects incoming XML payloads encrypted with non-GCM data ciphers (such as AES-CBC or 3DES). Previously, unmarshal() accepted any data cipher declared in the incoming EncryptedData element regardless of the configured xmlCipherAlgorithm.

Routes that intentionally decrypt non-GCM payloads must explicitly configure a non-GCM xmlCipherAlgorithm (for example AES_128 or AES_256) on the receiving XMLSecurityDataFormat.

camel-seda - a non-empty queue is retained when its last producer stops

When all producers of a SEDA endpoint stop, the endpoint’s queue reference is now kept as long as it still holds messages — it is only removed when the queue is empty. Previously, the queue reference was always removed on the last producer stop, so a consumer that started afterwards received a fresh empty queue and lost the buffered messages. The empty-queue case is unaffected: a queue that holds no messages when its last producer stops is still removed as before.

A retained queue is released once a consumer has drained it and its endpoint shuts down, or when the SEDA component (or the CamelContext) itself stops. While the queue holds undelivered messages, any attempt to create a new SEDA endpoint for the same key with different queue parameters (for example a different size or multipleConsumers setting) will raise an IllegalArgumentException ("Cannot use existing queue …​") when its producer or consumer starts, the same error that was already raised when the endpoint was still active. Before this change, the released queue was silently replaced with a fresh one, which caused the buffered messages to be discarded.

camel-seda - size and concurrentConsumers sentinel values are now respected

Two sentinel-value ambiguities in the SEDA component are fixed:

  • size=1000 (the SEDA default) or size=2147483647 (Integer.MAX_VALUE) explicitly set on an endpoint URI are now recognised as a user choice and respected. Previously these values were treated as "not set" and silently replaced by the component default. With this fix, an explicit size=1000 creates a queue of capacity 1000, and an explicit size=2147483647 creates an unbounded queue, regardless of the component’s default queue size. An endpoint that specifies a size that conflicts with the already-created queue of the same name now fails with IllegalArgumentException ("Cannot use existing queue … does not match"). Previously the conflicting size was silently ignored and the existing queue was reused as-is.

  • concurrentConsumers=1 together with virtualThreadPerTask=true is now preserved. Previously the value 1 was always reset to 0 (no limit). An endpoint with ?virtualThreadPerTask=true&concurrentConsumers=1 now processes at most one message at a time, where it previously had no limit. When concurrentConsumers is not set at all and virtualThreadPerTask=true, the behaviour is unchanged: the default of 1 is still changed to 0 (no limit).

camel-test-citrus - missing binary validation module now fails instead of silently falling back

When a citrus:validate/…​?messageType=BINARY (or BINARY_BASE64, GZIP_BASE64) endpoint cannot find a Citrus message validator and no other validator matches, validation now fails with a CitrusRuntimeException naming the type and listing the modules to add (for example citrus-validation-binary for binary and binary_base64, or citrus-validation-text for gzip_base64 and for the plaintext type).

Previously, MessageValidatorRegistry.findMessageValidators silently fell back to DefaultTextEqualsMessageValidator when no type-specific validator was registered, so a missing binary validation module caused plain-text body comparison (which always fails for byte payloads, but without a meaningful error message).

For text message types (json, xml, yaml, plaintext), MessageValidatorRegistry still retries with the XML, JSON and finally PLAINTEXT fallback validators before it declares a validator missing, so a text body with messageType=JSON and no citrus-validation-json on the classpath continues to be compared as plain text when citrus-validation-text is present. Add the required validation module to get type-specific validation. This also affects header-only validation specs, whose type is auto-detected as plaintext; these now require citrus-validation-text to be on the classpath to avoid falling back silently.

Note: the gzip message type (without base64 encoding) has been removed from the documented types. Use gzip_base64 instead (requires citrus-validation-text).

camel-aws2-translate - a String CamelAwsTranslateTerminologyNames header is used, and other types fail

The CamelAwsTranslateTerminologyNames header can now be a String with one terminology name or names separated by commas, as well as a String[] or a Collection of names. Before, a String header was ignored, and the text was translated without a custom terminology. A route that sets this header as a String now sends the names to Amazon Translate, so a name that does not exist now fails the request with a ResourceNotFoundException from AWS.

A header of another type, such as an Integer, now fails the exchange with an IllegalArgumentException instead of being ignored.

camel-robotframework - obsolete options suppressed, variables passthrough fixed

Five endpoint options that were forwarded to Robot Framework but no longer exist in Robot Framework 4.1.2 (the version bundled with this component) now no longer cause the run to fail with return code 252. Setting them is now a silent no-op:

  • runMode (removed in Robot Framework 2.8; use dryrun, exitOnFailure, skipTeardownOnExit and randomize instead)

  • splitOutputs (removed in Robot Framework 3.0)

  • summaryTitle (removed in Robot Framework 3.0)

  • monitorWidth (removed in Robot Framework 3.0)

  • warnOnSkippedFiles (removed in Robot Framework 3.0)

The monitorColors option, which previously caused the run to fail because it was sent as the removed --monitorcolors flag, is now forwarded as --consolecolors. Valid values are auto (the default), on, ansi, and off.

The variables option previously declared in the endpoint URI was not passed to Robot Framework. It is now forwarded as --variable arguments. Variables set by the exchange message (body, headers, or exchange variables) are added after the endpoint variables and take precedence over them when a variable name collides.

camel-mina - disconnectOnNoReply is used by the consumer

The camel-mina section of the 4.24 upgrade guide says that disconnectOnNoReply no longer has an effect. This only applies to the producer, which always closes its session when a request times out. A synchronous consumer uses the option: with disconnectOnNoReply=false it keeps the session open when the route ends with no body.

camel-infinispan - no longer depends on infinispan-query

camel-infinispan and camel-infinispan-common no longer depend on org.infinispan:infinispan-query. That artifact is the Infinispan embedded query engine, which Hot Rod clients don’t need: the query API that the component uses ships in infinispan-commons. Remote queries and continuous queries work as before.

As a result, applications that use camel-infinispan no longer get infinispan-query, infinispan-core, JGroups, Hibernate Search or Lucene on their classpath through it. If your application also starts an embedded cache manager or uses the embedded query engine, use camel-infinispan-embedded, or add these dependencies yourself.

camel-spring-redis - SpringRedisIdempotentRepository.clear() deletes only the set of the repository

SpringRedisIdempotentRepository.clear() (also the clear JMX operation) now deletes only the Redis set named by repositoryName, which holds the keys of the repository. Before, it ran FLUSHDB, which deleted every key of the selected Redis database, including data that does not belong to the repository. The flushOnStartup option is unchanged: it still deletes all keys of the database when the repository starts.