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

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-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.