이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Upgrading Red Hat build of Apache Camel on Spring Boot version with Camel update recipes
Migrating the code for Apache Camel on Spring Boot often involves adapting to new Camel API changes and renaming the classes. To address this, you can use Camel update recipes based on OpenRewrite. These recipes assists with manual migrations and make it more efficient.
You can update the Red Hat build of Apache Camel on Spring Boot application using Camel JBang. Camel JBang provides the camel update command. It has two main operations:
-
run: Executes the actual update process
The update process uses the Apache Camel Open Rewrite recipes. It supports following application types:
- Plain Camel (camel-main)
- Camel Quarkus
- Camel Spring Boot
Here, Camel and Camel Spring Boot updates mainly use the camel-upgrade-recipes, while Camel Quarkus updates involve both the Quarkus runtime (via Rewrite Quarkus) and Apache Camel recipes.
5.1. Running Camel Updates 링크 복사링크가 클립보드에 복사되었습니다!
To perform the update to this version, use:
camel update run {camelSpringBootVersion} --runtime=spring-boot
$ camel update run {camelSpringBootVersion} --runtime=spring-boot
The update commands must be executed in the project directory that contains the pom.xml file.
5.1.1. Configuration Options 링크 복사링크가 클립보드에 복사되었습니다!
You can customize the update process with several options that are available:
--runtime: Specifies the application type:-
spring-boot- Camel Spring Boot applications
-
-
--repos: Additional Maven repositories to use during the update -
--dry-run: Preview the changes without applying them -
--extraActiveRecipes: Comma-separated list of additional recipe names to apply -
--extraRecipeArtifactCoordinates: Comma-separated list of Maven coordinates for extra recipes (format: groupId:artifactId:version) -
--help: To see all available options.
5.1.2. Updating a plain Camel application 링크 복사링크가 클립보드에 복사되었습니다!
Following example shows how to update a plain Camel application.
camel update run 4.10.7.redhat-00013 --runtime=camel-main --repos=https://myMaven/repo --extraActiveRecipes=my.first.Recipe,my.second.Recipe --extraRecipeArtifactCoordinates=ex.my.org:recipes:1.0.0
$ camel update run 4.10.7.redhat-00013 --runtime=camel-main --repos=https://myMaven/repo --extraActiveRecipes=my.first.Recipe,my.second.Recipe --extraRecipeArtifactCoordinates=ex.my.org:recipes:1.0.0
5.1.3. Updating a Spring Boot application 링크 복사링크가 클립보드에 복사되었습니다!
You can use the following command to update a Spring Boot application. You can use the -extraActiveRecipes option to run the extra Spring Boot upgrade.
camel update run 4.10.7.redhat-00013 --runtime=spring-boot --extraActiveRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3 --extraRecipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:6.0.2
$ camel update run 4.10.7.redhat-00013 --runtime=spring-boot --extraActiveRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3 --extraRecipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:6.0.2