3.6. Camel 更新レシピを使用して Red Hat build of Apache Camel on Spring Boot バージョンをアップグレードする


Spring Boot 上の Apache Camel のコードを移行する場合は頻繁に、新しい Camel API の変更に適応し、クラスの名前を変更する必要があります。これを解決するには、OpenRewrite に基づく Camel 更新レシピを使用できます。これらのレシピは手動による移行を支援し、効率化を図ります。

Camel JBang を使用して、Red Hat build of Apache Camel on Spring Boot アプリケーションを更新できます。Camel JBang は、camel update コマンドを提供します。主な操作は 2 つあります。

  • run: 実際の更新プロセスを実行する

更新プロセスでは Apache Camel Open Rewrite レシピ が使用されます。次のアプリケーションタイプをサポートします。

  • Plain Camel (camel-main)
  • Camel Quarkus
  • Camel Spring Boot (Spring Boot で実行)

ここで、Camel および Camel Spring Boot の更新では主に camel-upgrade-recipes が使用され、Camel Quarkus の更新では Quarkus ランタイム (Rewrite Quarkus 経由) と Apache Camel レシピの両方を利用します。

3.6.1. Camel 更新の実行

このバージョンへの更新を実行するには、次を使用します。

$ camel update run {camelSpringBootVersion} --runtime=spring-boot
注記

更新コマンドは、pom.xml ファイルが含まれているプロジェクトディレクトリーで実行する必要があります。

3.6.1.1. 設定オプション

利用可能ないくつかのオプションを使用して更新プロセスをカスタマイズできます。

  • --runtime: アプリケーションの種類を指定します。

    • spring-boot - Camel Spring Boot アプリケーション
  • --repos: 更新中に使用する追加の Maven リポジトリー
  • --dry-run: 変更を適用せずにプレビューする
  • --extraActiveRecipes: 適用する追加のレシピ名のコンマ区切りリスト
  • --extraRecipeArtifactCoordinates: 追加レシピの Maven 座標のコンマ区切りリスト (形式: groupId:artifactId:version)
  • --help: 利用可能なすべてのオプションを表示します。

3.6.1.2. 通常の Camel アプリケーションの更新

次の例は、通常の Camel アプリケーションを更新する方法を示しています。

$ camel update run 4.10.6.redhat-00009 --runtime=camel-main --repos=https://myMaven/repo --extraActiveRecipes=my.first.Recipe,my.second.Recipe --extraRecipeArtifactCoordinates=ex.my.org:recipes:1.0.0

3.6.1.3. Spring Boot アプリケーションの更新

次のコマンドを使用して、Spring Boot アプリケーションを更新できます。-extraActiveRecipes オプションを使用して、追加の Spring Boot アップグレードを実行できます。

$ camel update run 4.10.6.redhat-00009 --runtime=spring-boot --extraActiveRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3 --extraRecipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:6.0.2
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る