Camel 2.x/3.x Upgrade

Modernize Apache Camel 2.x/3.x projects to Camel 4.x YAML DSL

Overview

Camel-Kit helps you modernize legacy Apache Camel 2.x/3.x projects to Camel 4.x with YAML DSL, including projects based on Red Hat Fuse 6.x/7.x. The AI assistant analyzes your existing routes, configuration, and deployment artifacts, then generates updated code following Camel 4.x best practices.

Key transformations handled by Camel-Kit:

  • XML DSL to YAML DSL — Spring XML and Blueprint XML routes converted to modern YAML syntax
  • Deprecated components — Automatic replacement with Camel 4.x equivalents
  • OSGi Blueprint to configuration files — Blueprint service definitions migrated to application.properties or application.yaml
  • Karaf features to Maven dependencies — OSGi feature bundles converted to standard Maven dependencies
  • Platform modernization — Migration paths from Karaf/OSGi to Spring Boot or Quarkus

What Gets Parsed

Camel-Kit analyzes the following artifacts from your Camel 2.x/3.x project:

ArtifactDescription
Camel Context XML (Spring/Blueprint)Route definitions, endpoint configurations, error handlers
Java DSL routes (RouteBuilder)Programmatic route definitions
Properties filesConfiguration properties, endpoint URIs, credentials
Blueprint XMLOSGi service wiring, bean definitions
Karaf featuresDependency bundles, OSGi feature declarations
fabric8 descriptorsContainer metadata, deployment configuration

The AI assistant parses all these artifacts together to understand the complete application structure before generating the modernized output.

Deprecated Component Updates

Several Camel components were renamed, consolidated, or removed in Camel 4.x. Camel-Kit automatically updates component references to their modern equivalents:

Old Component (2.x/3.x)New Component (4.x)
camel-http4camel-http
camel-jetty9camel-jetty
camel-netty4camel-netty
camel-netty4-httpcamel-netty-http
camel-activemqcamel-jms (with ActiveMQ client)
camel-mina2camel-mina
camel-quartz2camel-quartz
camel-rxjava2Removed (use Camel reactive streams)
camel-mongodb3camel-mongodb
camel-hdfs2camel-hdfs

The AI will also flag components that have been fully removed and suggest modern alternatives.

Platform Migration Paths

Karaf/Blueprint → Spring Boot or Quarkus

For projects running on Apache Karaf or Red Hat Fuse Karaf distributions:

  • OSGi Blueprint (<blueprint> XML) is replaced with application.properties or application.yaml configuration files
  • Karaf features (feature XML files) are converted to standard Maven <dependency> declarations in pom.xml
  • OSGi service injection (<reference> tags) is replaced with CDI beans (Quarkus) or Spring dependency injection (Spring Boot)

The AI will ask which target platform you prefer (Spring Boot or Quarkus) and generate the appropriate configuration.

Spring XML → YAML DSL

For projects using Spring XML-based Camel configuration:

  • <camelContext> and <route> elements are converted to .camel.yaml route files
  • <bean> definitions are migrated to CDI beans (Quarkus) or Spring @Component classes (Spring Boot)
  • <endpoint> declarations are converted to inline URIs within routes

Bean references are preserved using the same bean IDs in the target platform’s dependency injection framework.

Java DSL → YAML DSL (Optional)

Camel-Kit can optionally convert Java DSL RouteBuilder classes to YAML route files. However, Java DSL is still fully supported in Camel 4.x, so this conversion is not always necessary or desired.

The AI assistant will ask whether you want to:

  • Keep Java DSL routes (recommended for complex logic, dynamic routing, or heavy use of processors)
  • Convert to YAML DSL (recommended for simple declarative routes)

You can mix both approaches in the same project.

Common Scenarios

Red Hat Fuse Detection

Camel-Kit automatically detects Red Hat Fuse-based projects by looking for redhat-* or fuse-* version qualifiers in Maven dependencies (e.g., camel-core-2.23.2.fuse-7_11_1-00015).

For Fuse 6.x or 7.x projects, you can explicitly specify the source platform:

camel-kit migrate --source-platform fuse

This ensures the AI uses Fuse-specific component mappings and generates migration notes for Red Hat-specific features.

Next Steps

After generating the modernized Camel 4.x code:

  1. Review the generated YAML routes and configuration files
  2. Update any custom processors or beans to use Jakarta EE APIs (if migrating to Quarkus)
  3. Test routes locally using camel run (JBang) or your target platform’s dev mode
  4. Consult the Apache Camel 4.x Migration Guide for additional breaking changes

Camel-Kit handles the most common migration patterns automatically, but complex integrations may require manual adjustments.