Red Hat Camel K is no longer supported.
As of June 30, 2025, Red Hat build of Camel K has reached End of Life. The suggested replacements is Red Hat build of Apache Camel. For details about moving, see the Camel K to Camel Quarkus migration guide.3.3. 在 YAML 中开发 Camel K 集成
本节介绍如何在 YAML DSL 中开发简单的 Camel K 集成。编写 YAML 中的集成以使用 Camel K 部署与在 Camel 中定义路由规则的方式相同。
您可以直接在集成路由中使用任何 Camel 组件。Camel K 会自动处理依赖项管理,并使用代码检查从 Camel 目录中导入所有所需的库。
先决条件
流程
输入
kamel init
命令来生成简单的 YAML 集成文件。例如:kamel init hello.camelk.yaml
$ kamel init hello.camelk.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 打开 IDE 中生成的集成文件,并根据需要编辑。例如,
hello.camelk.yaml
集成自动包含 Camel计时器
和日志
组件,以帮助您开始:Copy to Clipboard Copied! Toggle word wrap Toggle overflow