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.15 to 4.16

camel-infinispan

The queryBuilder option on camel-infinispan endpoint has been migrated to no longer use the deprecated query factory org.infinispan.query.dsl.QueryFactory to the new query API that is based on ickle query syntax.

This means old code such:

    private InfinispanQueryBuilder continuousQueryBuilder
            = qf -> qf.from(User.class).having("name").like("CQ%").build();

Should use the ickle query syntax:

    private InfinispanQueryBuilder continuousQueryBuilder
            = qf -> qf.query("FROM sample_bank_account.User WHERE name LIKE 'CQ%'");

camel-milo

The camel-milo component has been upgraded to use Eclipse Milo 1.0.5, which includes several breaking API changes:

Certificate Validation API Changes

The certificate validation API has been refactored in Milo 1.0.5:

  • The ServerCertificateValidator class has been removed

  • Use org.eclipse.milo.opcua.stack.core.security.CertificateValidator instead

  • The new CertificateValidator is located in the core security package rather than the server-specific package

If you were programmatically configuring certificate validators, you need to update your code:

// Old API (no longer works)
import org.eclipse.milo.opcua.stack.server.security.ServerCertificateValidator;
server.setCertificateValidator(serverCertificateValidator);

// New API (Milo 1.0.5)
import org.eclipse.milo.opcua.stack.core.security.CertificateValidator;
server.setCertificateValidator(certificateValidator);

Subscription Monitoring API Changes

The monitored item data value listener API has changed:

  • The DataValueListener now requires two parameters: OpcUaMonitoredItem and DataValue

  • Previously it only accepted a DataValue parameter

If you were using custom data value listeners, update your lambda expressions or anonymous classes:

// Old API
item.setDataValueListener(dataValue -> processValue(dataValue));

// New API (Milo 1.0.5)
item.setDataValueListener((monitoredItem, dataValue) -> processValue(dataValue));
Most users will not be affected by these changes as they primarily affect advanced use cases where you directly interact with the Milo API. Standard camel-milo endpoint configurations remain unchanged.